[boost] filesystem lib & linking (MSVC.NET)
Hi All, I'm trying to use the filesystem lib, but I'm having some problems figuring out how to build it properly. I'm using MSVC.NET on WindowsXP, and I ran the bjam tool like in the docs for the whole set of libraries. It took me a while to figure out where it had put everything, and finally found a file called libboost_filesystem.lib. I copied it to a convenient location, added the library path and lib file to my project settings, and then tried to link my app. MSVC then gave a bunch of linker errors, and suggested to add MSVCRT to the nodefaultlib setting, so I did that, and got less linker errors. All that is left is some thing to do with exception & string classes. Linker errors are all about multiply defined symbols. I suppose I'm doing something wrong somewhere along the line, but not sure what. I can't tell if bjam is actually doing what it's supposed to, and the documentation around the place can be pretty sparse in places, so I hope someone can point out what I can do to get things working. Regards, Jonathan Roewen
It sounds like you are having runtime library conflicts. Everything you compile with should use the same runtime library. For example if you compiled the lib with static link multithreaded, then don't use dynamic link multithreaded, etc. Sometimes you can get around it with the /NODEFAULTLIB but for me at least sometimes it doesn't work. Since I have the source code to all of my libraries I use I recompile for the target runtime. Maybe there is a way around it (esp if companies distribute only binaries), but I've been able to link against the same runtime, every time, so it's probably easier and safer that way. Jason Jonathan Roewen wrote:
Hi All,
MSVC then gave a bunch of linker errors, and suggested to add MSVCRT to the nodefaultlib setting, so I did that, and got less linker errors. All that is left is some thing to do with exception & string classes. Linker errors are all about multiply defined symbols.
It sounds like you are having runtime library conflicts. Everything you compile with should use the same runtime library. For example if you compiled the lib with static link multithreaded, then don't use dynamic link multithreaded, etc.
Oh okay. So next question: how do I tell bjam to use a specific runtime library for MSVC then? Jon
Jonathan Roewen wrote:
Oh okay. So next question: how do I tell bjam to use a specific runtime library for MSVC then?
for multi/single threaded, add -sBUILD="<threading>multi" (or single) I think there is a <runtime-link>dynamic or <runtime-link>static but can't quite remember, I'm sure someone else can correct my on that. Thanks Russell
Hi I had the same problems - but got it down to one symbol what was un-resolved. I gave up and took the boost/lib/filesystem/src files made a BoostFilesystem static library project in MSVC7.1 put the right threading parameters etc. on the project and it compiled and the generated library link into my application without any problems. I tried this both for boost 1.30.0 and the boost version from the main CVS - with the same result - so I took the same approch as with the threading library - make it yourself as a MSVC project. Hope this solved your problems right now - hopefully the jam system will be updated in the next release to do it with bjam instead. /Anders On Mon, 2003-08-04 at 08:55, Russell Hind wrote:
Jonathan Roewen wrote:
Oh okay. So next question: how do I tell bjam to use a specific
runtime
library for MSVC then?
for multi/single threaded, add
-sBUILD="<threading>multi"
(or single)
I think there is a <runtime-link>dynamic or <runtime-link>static but can't quite remember, I'm sure someone else can correct my on that.
Thanks
Russell
Yahoo! Groups Sponsor ADVERTISEMENT click here
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------- Anders Hybertz Senior Software Architect Hydra Development Team Mobile Cohesion Ltd. [Non-text portions of this message have been removed]
participants (4)
-
Anders Hybertz
-
Jason Winnebeck
-
Jonathan Roewen
-
Russell Hind