Re: Building QL using minwg and msys
Posted by
igitur on
URL: http://quantlib.414.s1.nabble.com/Building-QL-using-minwg-and-msys-tp15836p15927.html
Hi,
As a workaround, I created a separate compiler profile which builds up a response file (
http://support.microsoft.com/kb/40429/en-gb ) (the list of .obj files) and passes this file to the linker, instead of trying to link an incredibly long argument list. I think it's a terrible hack, but it works.
So what I did was:
- Install Code::Blocks and a working cygwin or babun environment (or anything with a bash interpreter)
- Open it and go to Settings, Compiler
- Make a copy of Microsoft Visual C++ 2010 (or whichever version you have - I assume you do have MSVC++ compiler somewhere on your system) and call it Microsoft Visual C++ 2010 using response file
- Go to Other Settings | Advanced options and choose Link object files to static library (because we compile QuantLib as a static library
- Change the command line macro to:
bash -c "/usr/bin/find $objects_output_dir -name '*.obj' > $objects_output_dir/objects_listing.txt"
$lib_linker /lib /nologo $libdirs /out:$static_output $libs $link_resobjects $link_options @"$objects_output_dir\objects_listing.txt"
- For the above macro to work, bash.exe must be somewhere in your PATH, or you have to specify the exact path to your bash.exe
- Save all that and import the QuantLib_vc10.sln solution.
- After successfully importing the solution, right-click on QuantLib project, Build options and choose the new 'Microsoft Visual C++ 2010 using response file' compiler option.
- You'll have to set a number of other compiler and linker flags to build the project too. I attach my .cbp file to assist you, but I don't claim it's 100% correct.
- Build QuantLib
This hack is required only for the QuantLib project. The other example projects and test suite should work using the usual MSVC++ compiler setup.
(Sorry, Stephan, I know I promised you this a while ago.)
But given all this effort, isn't it easier to try to get it working in Microsoft Visual Studio Express rather? The reason I used Code::Blocks was because I'm stranded with a low resource office PC and Code::Blocks is just more RAM efficient than VS. There are also other problems with the above approach, e.g. if objects are removed from the project, you'll have to clean the objects directory first or the linker might try to link it again.
regards
------------------------------------------------------------------------------
Slashdot TV. Videos for Nerds. Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users