Linking boost in Visual Studio VC++ project

Hi ! I'm trying to find out how to link boost libraries under windows to a visual studio VC++ project (that will be a .dll library). Where can I find some information ?! I've compiled the boost libraries and followed the instruction found at: http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html but when I build the project it gives me an error trying to find a libboost_filesystem-vc80-mt-gd-1_41.lib, but no one libraries build starts with the 'lib' prefix ? Why he search for them ? Thank you, Federico

2010/3/26 Federico Golfrè Andreasi
Hi !
I'm trying to find out how to link boost libraries under windows to a visual studio VC++ project (that will be a .dll library).
Where can I find some information ?!
I've take that from an old doc, but I assume the flag is still the same. "If you are linking to a dynamic runtime, then you can choose to link to either a static or a dynamic Boost library, the default is to do a static link. You can alter this for a specific library *whatever* by defining BOOST_WHATEVER_DYN_LINK to force Boost library *whatever* to be linked dynamically. Alternatively you can force all Boost libraries to dynamic link by defining BOOST_ALL_DYN_LINK." from: http://www.boost.org/doc/libs/1_33_1/more/getting_started.html
I've compiled the boost libraries and followed the instruction found at: http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
but when I build the project it gives me an error trying to find a libboost_filesystem-vc80-mt-gd-1_41.lib, but no one libraries build starts with the 'lib' prefix ? Why he search for them ?
By default (I think it is default) Boost will autolink the static libraries, which are named (on Windows) libboost_something.lib. So you will have to tell Boost it should link to dynamic libraries. (See the quotation above). regards, Norbert

Hi Federico,
the solution is quite simple, all you need is this two steps:
1. Go to Project->Properties->Configuration Properties->C/C++->General
under Additional Include Directories add path to your boost includes
I have: D:\apps\boost\boost_1_42
2. Go to Project->Properties->Configuration Properties->Linker->General
under Additional Library Dependencies add path to your boost lib directory
I have: D:\apps\boost\boost_1_42\lib
i have compiled the example from
http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html and
it is working w/out issues.
Hope it helps
Ferdinand
2010/3/26 Federico Golfrè Andreasi
Hi !
I'm trying to find out how to link boost libraries under windows to a visual studio VC++ project (that will be a .dll library).
Where can I find some information ?!
I've compiled the boost libraries and followed the instruction found at: http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
but when I build the project it gives me an error trying to find a libboost_filesystem-vc80-mt-gd-1_41.lib, but no one libraries build starts with the 'lib' prefix ? Why he search for them ?
Thank you,
Federico
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

AMDG Federico Golfrè Andreasi wrote:
I'm trying to find out how to link boost libraries under windows to a visual studio VC++ project (that will be a .dll library).
Where can I find some information ?!
I've compiled the boost libraries and followed the instruction found at: http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
but when I build the project it gives me an error trying to find a libboost_filesystem-vc80-mt-gd-1_41.lib, but no one libraries build starts with the 'lib' prefix ? Why he search for them ?
To build all variants use bjam --build-type=complete toolset=msvc stage If you want that specific library only, bjam --with-filesystem link=static threading=multi debug runtime-link=shared stage In Christ, Steven Watanabe
participants (4)
-
Federico Golfrè Andreasi
-
Ferdinand Urban
-
Norbert Wenzel
-
Steven Watanabe