switch on multi threading in visual studio using boost libraries
-
Hi, I am trying to enable Boost multi threading in Visual Studio 2003.
#include < boost/thread/thread.hpp > // gives errors (see below) #include < boost/lambda/lambda.hpp > // this is ok, no errors reported so it can "see" the boost libraries int main() { return 0; }
I went to PROJECT -> PROPERTIES -> C/C++ -> COMMAND LINE and added/MT
but I get the following compile errorsmain Command line warning D4025 : overriding '/MLd' with '/MT' main Command line warning D4025 : overriding '/MT' with '/MLd' main Command line warning D4025 : overriding '/MLd' with '/MT' main fatal error LNK1104: cannot open file 'libboost_thread-vc71-mt-sgd-1_38.lib'
does anyone know how to switch it on? Had a scout round on the net but to no avail :( Thanks for any information. -
Hi, I am trying to enable Boost multi threading in Visual Studio 2003.
#include < boost/thread/thread.hpp > // gives errors (see below) #include < boost/lambda/lambda.hpp > // this is ok, no errors reported so it can "see" the boost libraries int main() { return 0; }
I went to PROJECT -> PROPERTIES -> C/C++ -> COMMAND LINE and added/MT
but I get the following compile errorsmain Command line warning D4025 : overriding '/MLd' with '/MT' main Command line warning D4025 : overriding '/MT' with '/MLd' main Command line warning D4025 : overriding '/MLd' with '/MT' main fatal error LNK1104: cannot open file 'libboost_thread-vc71-mt-sgd-1_38.lib'
does anyone know how to switch it on? Had a scout round on the net but to no avail :( Thanks for any information.You set that with the C/C++->Code Generation->Runtime Library project property rather than on the command-line. Also, you need to set different options for Debug and Release builds. [edit] And please remove the /MT from the Command Line properties![/edit] In addition, you either haven't told the linker where to find the Boost libraries (use the Linker->General->Additional Library Directories project property) or haven't built them completely (or did you use the Boost Consulting installer?).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
You set that with the C/C++->Code Generation->Runtime Library project property rather than on the command-line. Also, you need to set different options for Debug and Release builds. [edit] And please remove the /MT from the Command Line properties![/edit] In addition, you either haven't told the linker where to find the Boost libraries (use the Linker->General->Additional Library Directories project property) or haven't built them completely (or did you use the Boost Consulting installer?).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Wow, did'nt realise there was so much to do. I ran
bjam --build-dir="c:\program files\boost\boost_1_38\lib" --toolset=msvc --build-type=complete stage
where I have the bjam exe in the \boost_1_38\ directory but it gives an error*** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/Program Files/boost/boost_1_38/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:184: in configure C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:137: in msvc.init C:/Program Files/boost/boost_1_38/tools/build/v2/build\toolset.jam:38: in toolset.using C:/Program Files/boost/boost_1_38/tools/build/v2/build\project.jam:862: in using C:\Program Files\boost\boost_1_38\tools/build/v2\user-config.jam:59: in modules.load C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:241: in load-config C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:383: in load-configuration-files C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:520: in load C:\Program Files\boost\boost_1_38\tools\build\v2/kernel\modules.jam:283: in import C:\Program Files\boost\boost_1_38\tools\build\v2\kernel\bootstrap.jam:138: in boost-build C:\Program Files\boost\boost_1_38\boost-build.jam:16: in module scope
Ummm, any ideas? -
Wow, did'nt realise there was so much to do. I ran
bjam --build-dir="c:\program files\boost\boost_1_38\lib" --toolset=msvc --build-type=complete stage
where I have the bjam exe in the \boost_1_38\ directory but it gives an error*** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/Program Files/boost/boost_1_38/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:184: in configure C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:137: in msvc.init C:/Program Files/boost/boost_1_38/tools/build/v2/build\toolset.jam:38: in toolset.using C:/Program Files/boost/boost_1_38/tools/build/v2/build\project.jam:862: in using C:\Program Files\boost\boost_1_38\tools/build/v2\user-config.jam:59: in modules.load C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:241: in load-config C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:383: in load-configuration-files C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:520: in load C:\Program Files\boost\boost_1_38\tools\build\v2/kernel\modules.jam:283: in import C:\Program Files\boost\boost_1_38\tools\build\v2\kernel\bootstrap.jam:138: in boost-build C:\Program Files\boost\boost_1_38\boost-build.jam:16: in module scope
Ummm, any ideas?This is the command -line I used, from the root of my Boost 1.38.0 source unpack
bjam --toolset=msvc-7.1 --prefix=d:\lib\boost --build-type=complete install
My Boost libraries are in this sort of directory hierarchy:
- d:\lib\boost - Root of my Boost install - I've only got 7 versions of Boost installed. from 1.32.0 on :-O. You can see that I've told bjam that this directory is the root of my Boost library directory hierarchy.
- d:\lib\boost\include - contains all Boost header files in versioned sub-directories, such as D:\lib\boost\include\boost-1_38. Each versioned sub-directory contains a boost sub-directory which is the root of the include directory hierarchy. The versioned sub-directory is automatically created by the 'install' action in the jam file
- d:\lib\boost\lib - contains all Boost libraries and DLLs. The libs and DLLs are copied here by the 'install' action in the jam file
- d:\lib\boost\versioned directory containing source, docs etc. For example, D:\lib\boost\boost_1_38_0 for Boost 1.38.0. I
CD
into this directory before building that version of Boost. After building, I delete the bin.v2 directory, as it contains all the object files created by hte build process, which can be > 1GB in size.
I would certainly recommend using this sort of setup, as it's worked pretty flawlessly for me for (literally) years. The other thing I'd be concerned about with your setup is the 'Program Files' directory - I'm always worried about command-line tools and directories whose names contain spaces.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
This is the command -line I used, from the root of my Boost 1.38.0 source unpack
bjam --toolset=msvc-7.1 --prefix=d:\lib\boost --build-type=complete install
My Boost libraries are in this sort of directory hierarchy:
- d:\lib\boost - Root of my Boost install - I've only got 7 versions of Boost installed. from 1.32.0 on :-O. You can see that I've told bjam that this directory is the root of my Boost library directory hierarchy.
- d:\lib\boost\include - contains all Boost header files in versioned sub-directories, such as D:\lib\boost\include\boost-1_38. Each versioned sub-directory contains a boost sub-directory which is the root of the include directory hierarchy. The versioned sub-directory is automatically created by the 'install' action in the jam file
- d:\lib\boost\lib - contains all Boost libraries and DLLs. The libs and DLLs are copied here by the 'install' action in the jam file
- d:\lib\boost\versioned directory containing source, docs etc. For example, D:\lib\boost\boost_1_38_0 for Boost 1.38.0. I
CD
into this directory before building that version of Boost. After building, I delete the bin.v2 directory, as it contains all the object files created by hte build process, which can be > 1GB in size.
I would certainly recommend using this sort of setup, as it's worked pretty flawlessly for me for (literally) years. The other thing I'd be concerned about with your setup is the 'Program Files' directory - I'm always worried about command-line tools and directories whose names contain spaces.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Hmmm, I uninstalled my Boost folder from the previous location and installed it again in "C:\boost" so I can remove the space. I ran your commaned
bjam --toolset=msvc-7.1 --prefix=c:\boost --build-type=complete install
(where c:\boost is the root dir containing all the folders) but still get the errorC:\boost>bjam toolset=msvc-7.1 variant=debug threading=multi link=shared C:/boost/tools/build/v2/tools\msvc.jam:734: in configure-really *** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/boost/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called C:/boost/tools/build/v2/tools\msvc.jam:184: in configure C:/boost/tools/build/v2/tools\msvc.jam:137: in msvc.init C:/boost/tools/build/v2/build\toolset.jam:38: in toolset.using C:/boost/tools/build/v2/build\project.jam:862: in using C:\boost\tools/build/v2\user-config.jam:59: in modules.load C:/boost/tools/build/v2\build-system.jam:241: in load-config C:/boost/tools/build/v2\build-system.jam:383: in load-configuration-files C:/boost/tools/build/v2\build-system.jam:520: in load C:\boost\tools\build\v2/kernel\modules.jam:283: in import C:\boost\tools\build\v2\kernel\bootstrap.jam:138: in boost-build C:\boost\boost-build.jam:16: in module scope C:\boost>
So when you installed it you moved all the header folders etc. around?modified on Friday, July 10, 2009 7:49 AM
-
Hmmm, I uninstalled my Boost folder from the previous location and installed it again in "C:\boost" so I can remove the space. I ran your commaned
bjam --toolset=msvc-7.1 --prefix=c:\boost --build-type=complete install
(where c:\boost is the root dir containing all the folders) but still get the errorC:\boost>bjam toolset=msvc-7.1 variant=debug threading=multi link=shared C:/boost/tools/build/v2/tools\msvc.jam:734: in configure-really *** argument error * rule path.make ( native ) * called with: ( ) * missing argument native C:/boost/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called C:/boost/tools/build/v2/tools\msvc.jam:184: in configure C:/boost/tools/build/v2/tools\msvc.jam:137: in msvc.init C:/boost/tools/build/v2/build\toolset.jam:38: in toolset.using C:/boost/tools/build/v2/build\project.jam:862: in using C:\boost\tools/build/v2\user-config.jam:59: in modules.load C:/boost/tools/build/v2\build-system.jam:241: in load-config C:/boost/tools/build/v2\build-system.jam:383: in load-configuration-files C:/boost/tools/build/v2\build-system.jam:520: in load C:\boost\tools\build\v2/kernel\modules.jam:283: in import C:\boost\tools\build\v2\kernel\bootstrap.jam:138: in boost-build C:\boost\boost-build.jam:16: in module scope C:\boost>
So when you installed it you moved all the header folders etc. around?modified on Friday, July 10, 2009 7:49 AM
minkowski wrote:
So when you installed it you moved all the header folders etc. around?
The Boost build script does that.
minkowski wrote:
bjam toolset=msvc-7.1 variant=debug threading=multi link=shared
That doesn't match the command-line I shared - but even so, that comamnd-line works for me.... What version of bjam are you using? I'm using version 3.1.16. PS - to avoid building all the libraries, you might want to use one of the installers from BoostPro[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
minkowski wrote:
So when you installed it you moved all the header folders etc. around?
The Boost build script does that.
minkowski wrote:
bjam toolset=msvc-7.1 variant=debug threading=multi link=shared
That doesn't match the command-line I shared - but even so, that comamnd-line works for me.... What version of bjam are you using? I'm using version 3.1.16. PS - to avoid building all the libraries, you might want to use one of the installers from BoostPro[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Hmmm - I'm using 3.1.16. Googling "missing argument native" does indicate some other things to try - if you're using an Express version of MSVC, you may need to explicitly specify the version as an express one using
toolset=msvc-9.0express
ortoolset=msvc-8.0express
on the command-line. Aside from that, I'm a bit stumped - maybe posting to the Boost Users mailing list might help?Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Hmmm - I'm using 3.1.16. Googling "missing argument native" does indicate some other things to try - if you're using an Express version of MSVC, you may need to explicitly specify the version as an express one using
toolset=msvc-9.0express
ortoolset=msvc-8.0express
on the command-line. Aside from that, I'm a bit stumped - maybe posting to the Boost Users mailing list might help?Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Hi ya, I've got the enterprise version. Ok I'll try the Boost mailing list. Thanks for your efforts! :)
One last thing - bjam has a --debug-configuration flag that could help you see if things are a little out of kilter.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p