# Building boost with Dev-C++

This topic is 4755 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok, I've been trying for the past hour or so to convince boost that it wants to build with the version of mingw32 which comes with Dev-C++ (4.9.9.1), however I'm currently stumpped and all my ideas have run out [crying] I've got Dev-C++ installed to D:\Dev-Cpp I opened a command prompt (cmd.exe) Added the path to tools to the system path (path = %path%;d:\dev-cpp\bin) The called bjam with the following command line; G:\Programming\SDKs\boost_1_32_0>bjam "-sTOOLS=mingw" "-sMINGW_ROOT_DIRECTORY=D:\Dev-Cpp" install which promptly dumped out with a error of 'spawn: Invalid argument' Having googled around a bit I landed apon putting -d+4 in the command line to get some debug info, resulting in ; G:\Programming\SDKs\boost_1_32_0>bjam -d+4 "-sTOOLS=mingw" "-sMINGW_ROOT_DIRECTORY=D:\Dev-Cpp" install which gives me;
Executing raw command directly
Executing command ["D:\Dev-Cpp\mingw32\bin\g++"] ["-Wl,--enable-auto-image-base"
] ["-Wl,--exclude-symbols,_bss_end__:_bss_start__:_data_end__:_data_start__"] ["
-Wl,--out-implib,bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debugboost_date_time-mgw-d-1_32.lib"] [-g] [-shared] [-Wl,--allow-multiple-definition
] [-mno-cygwin] [-o] ["bin\boost\libs\date_time\build\boost_date_time.dll\mingwdebug\boost_date_time-mgw-d-1_32.dll"] [-L"D:/Dev-Cpp/mingw32/lib"] ["bin\boostlibs\date_time\build\boost_date_time.dll\mingw\debug\greg_month.obj"] ["bin\boos
t\libs\date_time\build\boost_date_time.dll\mingw\debug\greg_weekday.obj"] ["binboost\libs\date_time\build\boost_date_time.dll\mingw\debug\date_generators.obj"]

spawn: Invalid argument


so, I'm stumpped, anyone got any ideas?

##### Share on other sites
It printed out the command (with each individual command line parameter bracketed with []) - have you tried executing it manually?

##### Share on other sites
once I cleaned the command up (removed all the [] and ") and ran it it executed fine

D:\Dev-Cpp\bin\g++ -Wl,--enable-auto-image-base -Wl,--exclude-symbols,_bss_end__:_bss_start__:_data_end__:_data_start__ -Wl,--out-implib,bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debug\boost_date_time-mgw-d-1_32.lib -g -shared -Wl,--allow-multiple-definition -mno-cygwin -o bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debug\boost_date_time-mgw-d-1_32.dll -LD:/Dev-Cpp/lib bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debug\greg_month.obj bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debug\greg_weekday.obj bin\boost\libs\date_time\build\boost_date_time.dll\mingw\debug\date_generators.obj

You might notice a few bits are different, that was down to a bad copy and paste on my part, the above command line came after the output given by the build command I issued in my first post, which compiles 3 .obj correctly via some batch files and then fails on the linking line (which was the same as the line in my first post, just sans the 'minw32' parts of the paths.

So, it works by hand, but not via the bjam interface (which I have used to compile the library successfully for VC7.1 before), but I'm still no closer to understanding why or how to fix it as i dont fancy building the whole thing by hand...

##### Share on other sites
one quick bump to see if anyone else has any ideas, otherwise next stop boost mailing list [smile]

##### Share on other sites
hmm, i just built boost for DevC++ with
bjam "-sMINGW_ROOT_DIRECTORY=D:\Dev-Cpp" "-sTOOLS=mingw" install

but now, i don't really know how to use the lib *ouch*
usually i'd simply include the *.hpp file and copy the *.libs in DevC++' lib-folder.
but the boost libs are scattered in the boost/bin folder and exist in multiple versions...

##### Share on other sites
Quote:
 Original post by maximALbut now, i don't really know how to use the lib *ouch*usually i'd simply include the *.hpp file and copy the *.libs in DevC++' lib-folder.

Copy the "boost" directory, which contains all the header, to your "include" directory (so that you have include/boost/whatever.hpp)

Quote:
 but the boost libs are scattered in the boost/bin folder and exist in multiple versions...so: how to use...say...boost:thread?

At least they're all in the same folder, aren't they - that didn't use to be the case in early versions [grin]

Check here for an explanation of the multiple library versions.

##### Share on other sites
Quote:
 Original post by FrunyAt least they're all in the same folder, aren't they

actually - no. they all got some nice path like:

but someone pointed me to an DevC++ DevPak .
it seems to work for the moment, but i got no idea how good/complete/whatever it is...

##### Share on other sites
Quote:

Look in bin-stage. You may have to use the 'stage' make option instead of 'install'.

##### Share on other sites
you say i have to rebuild everythin again with "stage" instead of "install"?
another wasted hour :-/

and btw, can where can i set optimisation stuff for mingw (O3, march...)? i mean, when i'm allready building it...

##### Share on other sites
Quote:
 Original post by maximALyou say i have to rebuild everythin again with "stage" instead of "install"? another wasted hour :-/

Unless you've trashed the intermediate files, that shouldn't take long...

And actually, looking at the options (on the same page I linked earlier), with "install" the libraries should have ended up in C:\Boost\lib. Reading the documentation before you try and install something not a waste of time.

Quote:
 and btw, can where can i set optimisation stuff for mingw (O3, march...)? i mean, when i'm allready building it...

The options should be selected for you already. If you want to mess with them, see here, but you're on your own: I've never bothered.

##### Share on other sites
You have seen the messages regarding spaces in the mingw path on the Boost
lists, but what they do NOT mention is that if your EXISTING path has any
embedded spaces, anywhere, then you get this 'spawn invalid' error.

So strip your path of all dirs with spaces, then rerun bjam.

Should work.

- Kelly

##### Share on other sites
meh, that might well explain it as I'm pretty sure i've got some spaces in my path, once I get some time I'll look into it again, cheers