I want to build GhostScript 9.04 for Win32 and I have read the documentation to do so which details creating your own makefile project.
I was just curious about the "ghostscript.vcproj" I'm finding in the top level directory. If I convert this to VS2010, I seem to get a good build out of it.
Is there any reason not to use this "ghostscript.vcproj"? The build commandline seems to have some extra stuff in it than what is detailed in the documentation, so I was worried that it might be making some kind of specialized build. See below
nmake -f psi\msvc32.mak SBR=1 DEVSTUDIO= && nmake -f psi\msvc32.mak DEVSTUDIO= bsc
You can use the solutions supplied, they are fine and its what we use. If you would rather use nmake and the makefiles then that's fine too, the solutions simply use the makefiles so its sort of the same, just more convenient in some ways if you are using Visual Studio.
The 'extra stuff' is in there to support the visual studio source browser, basically to improve the experience when using Visual Studio, its not essential.
I'll see about updating the documentation in make.htm.
Sorry to bump a very old topic, but when attempting to compile GhostScript v.9.14.1 with Visual Studio 2015, I get these errors:
Error U1034 syntax error : separator missing lib.mak (line 51)
Error MSB3073 The command "nmake -f psi\msvc32.mak SBR=1 DEVSTUDIO= debug && nmake -f psi\msvc32.mak DEVSTUDIO= debugbsc" exited with code 2. ghostscript C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets
Here's the code at line 51 in lib.mak:
GLLCMS2CC=$(CC_SHARED) $(GCFLAGS) $(I_)$(GLI_) $(II)$(LCMS2SRCDIR)$(D)include$(_I) $(GLF_)
Is there any way to remedy this?
Thank you.
PS: Does this project build the DLL? Could we build the DLL ourselves?
Related
I decided to give the built-in CMake support in VS2017 a try, and instead of figuring out why our multi-library, multi-executable project has problems with find_package in the hand-crafted CMakeLists.txt files that it has used for years, I decided to try a simple project first, the FooBar example from the CMake wiki: https://cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
This project creates a shared library foo and an executable bar that links to this library, and is about as simple as they come. I unzipped the project, opened it with File->Open->Folder, the CMake configuration starts and succeeds. Fist thing I notice is that there's no more Build menu, no F7 shortcut to build my project, but instead, I have to select CMake->Build CMakeLists.txt :-( The Debug menu is similarly stunted, and quick debugging is why I use Visual Studio in the first place. This is already looking bad, but it gets worse:
The build fails with this output:
foo.vcxproj -> C:\Users\Enno\AppData\Local\CMakeBuild\639e9ecd-8891-eb38-b26b-ce84aa448eea\build\x86-Debug\foo\Debug\foo.dll
C:\Users\Enno\AppData\Local\CMakeBuild\639e9ecd-8891-eb38-b26b-ce84aa448eea\build\x86-Debug\bar\LINK : fatal error LNK1104: cannot open file '..\foo\Debug\foo.lib'
Thoughts:
The build directory is in %APPDATA%? That's going to be annoying.
There is indeed no .lib file in that location, just the .dll.
At this point I was becoming skeptical that this may not be a problem with VS2017, but maybe with the sample project itself, or with CMake. So I created a solution for VS2015 with cmake.exe -G "Visual Studio 14" ., which I opened in VS2015 and Voila! I got the same error message.
Is there a CMake genius on SO that can tell me what is wrong with this project?
Turns out: The example on the CMake wiki is not portable in the first place, so this has nothing to do with Visual Studio's built-in CMake support. It does not take into account that Windows needs export libraries for DLLs. Adding the correct __declspec(dllexport) incantations to foo.h resolves the error message.
I found all the information that I needed about shared libraries on Windows at this link:
http://gernotklingler.com/blog/creating-using-shared-libraries-different-compilers-different-operating-systems/
I'm working with Qt 4.8.3 and QtCreator, which I've compiled with msvc2010 as per the instructions here. Now however I need to link to GSL (Gnu Scientific Library), but currently I only know how to build it with g++ which produces linker errors just as described here, undoubtedly for the reason given in the answer by #EvanTeran. However, in my case, building Qt with g++ via cygwin is probably not an option--I've just come off a multi-day nightmare during which I tried to do just this, but could not, as recorded here. Surely there is a way to build gsl with msvc2010, but how? I have VS 2012 Express installed (though I've never used it before) in case there's a solution using it.
EDIT: Looking at CMake, it seems the best I can to is to manually create an entire hierarchy of CMakeLists.txt files for GSL. That's just a little too much so instead I've put a 100pt. bounty on the question mentioned above. Solving my problem the Visual Studio route (here) OR with g++ will get the bounty and the answer to both questions.
Update: The answer below worked great, but not seamlessly, possibly because I actually needed to compile under VS2012. A few tweaks to the code were required, such as explicit casts, which were tolerated under the previous compiler apparently but not mine. Otherwise things proceeded pretty smoothly.
I have implemented CMake build support for GSL here: https://github.com/ampl/gsl
CMake can either generate a Visual Studio solution or NMake makefiles. For example:
> git clone git://github.com/ampl/gsl.git
> cd gsl
> cmake .
-- Building for: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
...
This generates the solution (GSL.sln) and project files for Visual Studio 2010.
This CMake build script is now included in the contrib directory of the GSL Git repository git://git.savannah.gnu.org/gsl.git.
As of May 2014, building shared libraries (DLLs) is supported as well with GSL_SHARED option.
You can use CMake and create your own build from this repository for whatever Visual Studio version you are using. Check out the answer by #vitaut for more details.
I want to learn how to use QtWebKit by creating a simple project, but I can't even install it. I found some tutorials like this, but it's for the standard Qt package. I am using for another project the Visual Studio Qt Add-in, so I don't want to uninstall it.
I found some WebKit source code in Qt-VS, but I don't know what to do with it. It does not contain any Perl script so the tutorial above is not good for it, but it does contain some makefiles. Or should I download the QtWebKit package separately, and follow the tutorial above? Will it generate compatible libraries? (I could not find any Qt command prompt, and the tutorial says the VS command prompt must be compatible. How do I know it?) Also, where should I move the binaries generated, so the project made with the built-in Qt template in Visual Studio to be able to find these new files?
Sorry for these lame questions, but I get lost really fast when it comes to building stuff from source and not given in binary form.
I would appreciate any feedback or link to stuff
EDIT:
The only thing I could pull of is to install another copy of Qt, the normal one, and use it for the WebKit project changing the Qt environment variable value each time I'm switching the project, but that would be the lamest thing ever.
Download the Qt 4.7.3 source code:
http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip
Unzip and copy to a convenient location.
Open a Visual Studio 2010 command prompt.
You may need to run the command prompt as administrator. To do this, go to Start Menu > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools, right-click on Visual Studio Command Prompt (2010) and select Run as administrator.
To make a 64-bit build, select Visual Studio x64 Win64 Command Prompt (2010) instead.
Change the working directory to the Qt top folder.
Run the commands:
configure.exe -platform win32-msvc2010
nmake
Wait an hour.
This will build Qt, with all components, including QtWebKit.
Does this answer your question?
user763305's steps will work with these additions:
You need to install Perl. I used "ActiveState Perl"
You need to install WinFlex and WinBison. For some reason the QT script refers to the flex as "win_flex" but tries to find an executable called "bison.exe." I renamed "win_bison" to "bison.exe" and it worked.
I was also able to configure it successfully and build for msvc2012
configure.exe -platform win32-msvc2012
nmake
And it didn't take a few hours on my machine. Just about 55 minutes.
I know this has been asked before but I ran into a specific problem.
I'm trying to build ruby 1.9.2 rc2 on windows 7. When I run configure.bat it aborts with the following message.
cl -nologo -MD rtname.c user32.lib -link > nul
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
I find that the file 'rtname.c' does not exist anywhere within the source files. And this is why cl aborts.
I'm totally clueless as to what to do next. Searching for rtname.c on google doesn't return anything.
The first thing you have to do on windows is make sure your have some version of Visual studio C++ express edition installed. The latest version can be downloaded here
Next, you need to run the following file from the command line:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
This configures your path environmental variable to allow the command prompt (and other programs) to find cl.exe. After doing this, running configure.bat should work correctly. This will build a 32-bit version of Ruby.
Maybe Visual Studio is required in your case to build Ruby from sources on Windows, but why don't you use RubyInstaller instead? It is a nice build environment; you can compile any version of Ruby on your machine, even from TRUNK.
If I understand it correctly you must have the C++ compiler installed to build Ruby. Could it be that you are missing that?
The RubyInstaller is quite stable and works most times.
I found that having already installed ruby on the box helps, see http://blog.cyplo.net/2011/01/01/compiling-ruby-1-9-2-windows/ , hope that helps
Does anyone have instructions on building the opensource version of Qt? Now that the repository is opened up, I'm trying to build for VS2008 but I'm getting errors when it tries to build qmake.
I found the question I'm looking to use Visual Studio to write and compile using the open source version of Qt4 but this information is out of date, and doesn't really help me. For reference, here's what happens when I try to build with configure -platform win32-msvc2008
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -Foproject.obj -W3 -nologo -O2 -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -
IC:\dev\open_source\qt\include -IC:\dev\open_source\qt\include\QtCore -IC:\dev\open_source\qt\include -IC:\dev\open_sou
rce\qt\include\QtCore -IC:\dev\open_source\qt\src\corelib\global -IC:\dev\open_source\qt\include\QtScript -IC:\dev\op
en_source\qt\mkspecs\win32-msvc2008 -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL
-DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D
QT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED -DQMAKE_OPENSOURCE_EDITION project.cpp
project.cpp
c:\dev\open_source\qt\src\corelib\tools\qstringlist.h(45) : fatal error C1083: Cannot open include file: 'QtCore/qalgori
thms.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
Building qmake failed, return code 2
Well, one helpful thing is to run configure inside the Visual Studio Command Prompt. That should be available in the Visual Studio start menu group under Visual Studio Tools.
Also now when you run configure you don't have to specify target platform, because it will be set as an environment variable by the VS Command Prompt.
I got errors from configure and nmake when I did not use the VS Command Prompt, and since switching I have not had any issues.
So the simple instructions would be:
1) open VS command prompt
2) navigate to qt folder where configure.exe is located
3) configure
4) nmake
Please, ensure that you have ActiveState Perl installed
This blog article seems to have more recent information on building Qt with visual studio. Hope it helps.
Note that Nokia, as of Qt 4.6, is now providing their own open source VS builds of Qt, so it is no longer necessary to build from source yourself to do development with Visual Studio. Access their open source download page, and look for builds named (e.g.) qt-win-opensource-4.6.1-vs2008.exe.
Also, if you simply want to compile with MSVC so you can develop with the open source libraries with visual studio, I put together a project to provide "pre-built" Qt LGPL libraries with MSVC 2008.
It might be helpfull and has the advantages of taking up less space then compiling it yourself. It also provides a command prompt with all your environment variables set up for you and a link to launch Visual Studio with a Qt environment. It's called qt-msvc-installer.
What user156973 said. Install ActiveState perl and run configure again.