views:

96

answers:

4

I'm facing this problem. So, I need to build the support libraries (zlib, libtiff, libpng, libxml2, libiconv) with "Multithreaded DLL" (/MD) & "Multithreaded DLL Debug" (/MDd) run-time options. But the problem is there is no direct way . I mean there is no *.sln / *.vcproj file which I can open in Visual C++ and build it.

I'm aware with the GNU build system:

$./configure --with-all-sorts-of-required-switches
$./make
$./make install

During my search I've encountered with something called CMake which generates *.vcproj & *.sln file but for that CMakeLists.txt is required. Not all projects provide CMakeLists.txt.

I've never compiled anything from Visual C++ Command Line.

  • Generally most projects provide makefile. Now how do I generate *.vcproj / *.sln from this?

  • Can I compile with mingw-make of MinGW?

  • If I can, how do I set different options ("Multi-Threaded"(/MT), "Multi-Threaded Debug"(/MTd), "Multi-Threaded DLL"(/MD), "Multi-Threaded DLL Debug"(/MDd)) for run-time libraries?

  • I don't know what other ways are available. Please throw some light on this.

+2  A: 

You can just create a new project in Visual Studio and add the existing .cpp files to it.

Note that for several of the GNU libraries you've mentioned, you might have difficulty getting them to build on Microsoft Visual Studio's compiler, because as far as I know they are not shy about using GCC extensions in such programs.

Billy ONeal
+1  A: 

Most projects work, when you create an empty Win32 project and drag all files into that.

Then change the output paths and maybe click throught several options.

Christopher
+2  A: 

I believe all those projects include a .vcproj file (open/build in VC) and/or VC makefile (build with nmake).

Kyle Alons
"VC makefile (build with nmake).". Can you show how to use this like I showed for GNU build system in my question. How do I set /MD, /MDd, /MT, /MTd using this?
claws
also read http://stackoverflow.com/questions/2731211/windows-build-system-how-to-build-a-project-from-its-source-code-which-doesnt/2731261#2731261
claws
A: 

You can create wrapper scripts for the compiler+linker to call the VC compiler and give them to configure by ./configure CC=my-visual-c-script CXX=my-visual-c++-script. I hacked the compile script distributed with automake to do this thing. Note that automake calls the compiler also to link, so the wrapper must decide if it must call the compiler or the linker.

Rudi