views:

54

answers:

2

I understand that the fastest and the most lightweight binary at windows generate only msvc compiler

Express edition of msvc is free http://www.microsoft.com/express/windows/

but how to use cl.exe instead of g++.exe?

is it possible in common by using GNU make variables produce makefiles which will works with cl.exe and g++?

for example http://msdn.microsoft.com/en-us/library/19z1t1wy(v=VS.80).aspx

export CC = path/to/cl.exe
export COMPILE_WITHOUT_LINKING = /c
export OBJECT_FILE = /Fo

or is conception of cl and g++ very different?

+4  A: 

Of course you can. cl.exe is just another command line tool. However, the two compilers differ in more advanced usage, so it might be difficult to use cl.exe as a drop-in replacement for g++.

André Caron
+2  A: 

Make (GNU make or otherwise) can be used to run whatever programs you like for generating files. It's an abstract dependency generation system which is entirely language-agnostic. However, if you're trying to take an existing project that uses standard POSIX-style compiler/linker command lines, and make it use MSVC's cl.exe, you're probably going to run into a lot of problems with incompatible command line syntax, not to mention the fact that cl.exe is still struggling to conform to the ancient standards it purports to support, much less C99.

All in all, gcc is certainly a much better choice to use, if you have the choice.

R..