Building C++ project with Visual studio C++ compiler

Hi Guys

I have a C++ project with thousands of lines of code. Until now, i am using gnu make to build it under unix/linux but now i need to create C++ executables using the C++ compiler shipped with visual studio 2008.
Could someone please suggest a good way to automate the build process on windows? Does gnu make work on windows? What are my other options?
GNU make work on windows, as entire GCC suite, but if you want to use Microsoft compiler you need makefiles compatible with nmake (Microsoft version of make) or invoke the compiler from command-line directly passing appropiate arguments.
Thanks Modoran

I would probably want to modify my existing makefiles and not write new ones for windows.
So does gnu make under windows require cygwin? Are you aware of any tool which can generate Makefiles for me based on the target platform? (unix, windows or solaris)?



I don't agree with Mordoran's comment about needing the whole of the GCC suite. At least, not if you use the GnuWin32 version of make.
http://gnuwin32.sourceforge.net/packages/make.htm

make and nmake just invoke commands, so you should be able to use the Microsoft compiler with the GnuWin32 version of make easily enough. Or gcc with nmake, if you wanted to. (For example, I use both nmake and make -- independently -- with things like Doxygen and GraphViz, to create my code documentation)

GnuWin32 make does have a couple of dependencies, so if you wanted to extract it from the whole GnuWin32 install, you also need to grab libiconv2.dll (char set conversion) and libintl3.dll (internationalization stuff, I guess?)
http://stackoverflow.com/questions/4757911/where-is-libintl3-and-libiconv2-for-gnu-make-on-windows-needed-to-compile-vim-w

But the various compiler options will all have to be altered. And the default enviroment the make tool sets up might need tweaking. So if you have a common makefile which sets up you compiler, linker, etc. options you just have to tweak it. Elsewise you could have a lot of small changes to make.

When it comes to generation of platform specific makefiles (and VC++ projects and solutions), CMake appears to be quite popular:
http://www.cmake.org/

Andy
Last edited on
Topic archived. No new replies allowed.