Problem building boost on Windows
Hello,
I'm having some trouble building the Boost libraries on Windows.
- My OS is Windows Vista SP2
- My compiler in MinGW g++ 4.4. The folder containing the g++ executable
is in my PATH environment variable.
This is what I've done:
- Downloaded the latest version (1.41) of the Boost libraries
from www.boost.org and extracted it to C:\Dev\Libraries\boost
(so e.g. C:\Dev\Libraries\boost\libs is a subfolder)
- Downloaded the latest version (3.1.17) of Boost Jam from
http://sourceforge.net/projects/boost/files/boost-jam and
extracted bjam.exe into C:\Dev\Libraries\boost
- Opened up a command prompt, cd'd into C:\Dev\Libraries\boost
- Ran the command "bjam --with-filesystem variant=release link=static
threading=single toolset=gcc"
The output, up to the first error, is the following:
== START BJAM OUTPUT ==
WARNING: No python installation configured and autoconfiguration
failed. See http://www.boost.org/libs/python/doc/building.html
for configuration instructions or pass --without-python to
suppress this message and silently skip all Boost.Python targets
Building the Boost C++ Libraries.
After the build, the headers will be located at
C:\Dev\Libraries\boost
The libraries will be located at
C:\Dev\Libraries\boost\stage\lib
Use 'bjam install --prefix=<path>' if you wish to install headers and
libraries to a different location and remove the source tree.
...patience...
...found 441 targets...
...updating 27 targets...
common.mkdir stage
common.mkdir stage\lib
common.mkdir bin.v2
common.mkdir bin.v2\libs
common.mkdir bin.v2\libs\system
common.mkdir bin.v2\libs\system\build
common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0
common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release
common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static
gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o
g++: libs\system\src\error_code.cpp: No such file or directory
g++: no input files
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOO
ST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link
-static\error_code.o" "libs\system\src\error_code.cpp"
...failed gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o.
..
...skipped
AMDG Nathan Ridge wrote:
I'm having some trouble building the Boost libraries on Windows.
- My OS is Windows Vista SP2 - My compiler in MinGW g++ 4.4. The folder containing the g++ executable is in my PATH environment variable.
This is what I've done:
- Downloaded the latest version (1.41) of the Boost libraries from www.boost.org and extracted it to C:\Dev\Libraries\boost (so e.g. C:\Dev\Libraries\boost\libs is a subfolder) - Downloaded the latest version (3.1.17) of Boost Jam from http://sourceforge.net/projects/boost/files/boost-jam and extracted bjam.exe into C:\Dev\Libraries\boost - Opened up a command prompt, cd'd into C:\Dev\Libraries\boost - Ran the command "bjam --with-filesystem variant=release link=static threading=single toolset=gcc"
The output, up to the first error, is the following:
== START BJAM OUTPUT ==
WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python targets Building the Boost C++ Libraries. After the build, the headers will be located at C:\Dev\Libraries\boost The libraries will be located at C:\Dev\Libraries\boost\stage\lib Use 'bjam install --prefix=<path>' if you wish to install headers and libraries to a different location and remove the source tree.
...patience... ...found 441 targets... ...updating 27 targets... common.mkdir stage common.mkdir stage\lib common.mkdir bin.v2 common.mkdir bin.v2\libs common.mkdir bin.v2\libs\system common.mkdir bin.v2\libs\system\build common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0 common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o g++: libs\system\src\error_code.cpp: No such file or directory g++: no input files "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOO ST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link -static\error_code.o" "libs\system\src\error_code.cpp" ...failed gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o. .. ...skipped
libboost_system-mgw44-1_41 .lib(clean) for lack of error_code.o. .. ...skipped libboost_system-mgw44-1_41 .lib for lack of error_code.o... ...skipped libboost_system-mgw44-1_41.lib for lack of libboost_system-mgw44-1_41.lib... [more similar errors]
== END BJAM OUTPUT ==
So for some reason, it cannot find libs\system\src\error_code.cpp, which is actually located at C:\Dev\Libraries\boost\libs\system\src\error_code.cpp.
Am I supposed to somehow specify the exact path where it should be looking? I tried adding the option --build-dir=C:\Dev\Libraries\boost, but I still get the same error.
One suspicious thing that I noticed is that without the --build-dir option, the bin.v2 folder that is created is C:\Dev\bin.v2, as opposed to C:\Dev\Libraries\boost\bin.v2 or something like that. Not sure if this is related to my problem or not.
It sounds like it is related. This is really weird. It sounds like bjam is managing to change directories somehow. Can you open tools/build/v2/tools/gcc.jam, find the compile.c++ action and add the line cd before the call to gcc? You might also see whether building bjam from the source makes any difference. In Christ, Steven Watanabe
Steven Watanabe wrote:
AMDG
Nathan Ridge wrote:
I'm having some trouble building the Boost libraries on Windows.
- My OS is Windows Vista SP2 - My compiler in MinGW g++ 4.4. The folder containing the g++ executable is in my PATH environment variable.
This is what I've done:
- Downloaded the latest version (1.41) of the Boost libraries from www.boost.org and extracted it to C:\Dev\Libraries\boost (so e.g. C:\Dev\Libraries\boost\libs is a subfolder) - Downloaded the latest version (3.1.17) of Boost Jam from http://sourceforge.net/projects/boost/files/boost-jam and extracted bjam.exe into C:\Dev\Libraries\boost - Opened up a command prompt, cd'd into C:\Dev\Libraries\boost - Ran the command "bjam --with-filesystem variant=release link=static threading=single toolset=gcc"
The output, up to the first error, is the following:
== START BJAM OUTPUT ==
WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python targets Building the Boost C++ Libraries. After the build, the headers will be located at C:\Dev\Libraries\boost The libraries will be located at C:\Dev\Libraries\boost\stage\lib Use 'bjam install --prefix=<path>' if you wish to install headers and libraries to a different location and remove the source tree.
...patience... ...found 441 targets... ...updating 27 targets... common.mkdir stage common.mkdir stage\lib common.mkdir bin.v2 common.mkdir bin.v2\libs common.mkdir bin.v2\libs\system common.mkdir bin.v2\libs\system\build common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0 common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release common.mkdir bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o g++: libs\system\src\error_code.cpp: No such file or directory g++: no input files "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOO ST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link -static\error_code.o" "libs\system\src\error_code.cpp" ...failed gcc.compile.c++ bin.v2\libs\system\build\gcc-mingw-4.4.0\release\link-static\error_code.o. .. ...skipped
libboost_system-mgw44-1_41 .lib(clean) for lack of error_code.o. .. ...skipped libboost_system-mgw44-1_41 .lib for lack of error_code.o... ...skipped libboost_system-mgw44-1_41.lib for lack of libboost_system-mgw44-1_41.lib... [more similar errors]
== END BJAM OUTPUT ==
So for some reason, it cannot find libs\system\src\error_code.cpp, which is actually located at C:\Dev\Libraries\boost\libs\system\src\error_code.cpp.
Am I supposed to somehow specify the exact path where it should be looking? I tried adding the option --build-dir=C:\Dev\Libraries\boost, but I still get the same error.
One suspicious thing that I noticed is that without the --build-dir option, the bin.v2 folder that is created is C:\Dev\bin.v2, as opposed to C:\Dev\Libraries\boost\bin.v2 or something like that. Not sure if this is related to my problem or not.
It sounds like it is related.
This is really weird. It sounds like bjam is managing to change directories somehow. Can you open tools/build/v2/tools/gcc.jam, find the compile.c++ action and add the line cd before the call to gcc?
Did you mean 'pwd'? - Volodya
AMDG Vladimir Prus wrote:
Steven Watanabe wrote:
This is really weird. It sounds like bjam is managing to change directories somehow. Can you open tools/build/v2/tools/gcc.jam, find the compile.c++ action and add the line cd before the call to gcc?
Did you mean 'pwd'?
On windows the equivalent of pwd is cd with no arguments. In Christ, Steven Watanabe
From: watanabesj@gmail.com To: boost-users@lists.boost.org Subject: Re: [Boost-users] Problem building boost on Windows
Nathan Ridge wrote:
I'm having some trouble building the Boost libraries on Windows.
<snip>
So for some reason, it cannot find libs\system\src\error_code.cpp, which is actually located at C:\Dev\Libraries\boost\libs\system\src\error_code.cpp.
Am I supposed to somehow specify the exact path where it should be looking? I tried adding the option --build-dir=C:\Dev\Libraries\boost, but I still get the same error.
One suspicious thing that I noticed is that without the --build-dir option, the bin.v2 folder that is created is C:\Dev\bin.v2, as opposed to C:\Dev\Libraries\boost\bin.v2 or something like that. Not sure if this is related to my problem or not.
It sounds like it is related.
This is really weird. It sounds like bjam is managing to change directories somehow. Can you open tools/build/v2/tools/gcc.jam, find the compile.c++ action and add the line cd before the call to gcc?
You might also see whether building bjam from the source makes any difference.
In Christ, Steven Watanabe
I figured out the problem. Once upon a time, I used the hack described here http://windowsxp.mvps.org/autoruncmd.htm to get the Command Prompt to always start in C:\Dev because I was fed up with it always starting in C:\Windows\system32 and having to navigate away from there. Basically, the hack involves setting a registry key to get cmd to always execute "cd C:\Dev" on startup. The problem is, "always" really does mean "always", not just "when I start cmd from the GUI". At some point, bjam must have invoked cmd to run a batch script, which is when the unexpected directory change to C:\Dev happened. The website did caution that using this hack might affect the functionality of batch scripts, but at the time I ignored that. Now it came to bite me in the back... One more small thing: MinGW didn't recognize the .lib files produced by bjam. Simply renaming them to .a files worked for me, but I just wanted to make sure this is not another hack that hides some underlying problem and will bite me later. Thanks, Nate. _________________________________________________________________ Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you. http://go.microsoft.com/?linkid=9691817
Nathan Ridge wrote:
One more small thing: MinGW didn't recognize the .lib files produced by bjam. Simply renaming them to .a files worked for me, but I just wanted to make sure this is not another hack that hides some underlying problem and will bite me later.
This should be fixed in SVN HEAD -- which now uses .a for static libraries on mingw. - Volodya
participants (3)
-
Nathan Ridge
-
Steven Watanabe
-
Vladimir Prus