First time using the boost libs and stuck horribly

__thiscall boost::filesystem::path::root_directory(void)const " (?root_directory@path@filesyst em@boost@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
__thiscall boost::filesystem::path::root_name(void)const " (?root_name@path@filesystem@boost@@ QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
const *,struct std::bidirectional_iterato r_tag,int> __thiscall boost::filesystem::path::begin(void)const " (?begin@path@filesystem@boost@@QBE?AU?$iterator_adaptor@Upath_itr_imp@detail@filesystem@boost@@Udefault_iterator_policies@4@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@st d@@ABV67@PBV67@Ubidirectional_iterator_tag@7@H@3@XZ)
__thiscall boost::filesystem::path::leaf(void)const " (?leaf@path@filesystem@boost@@QBE?AV?$ba sic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
First of all, apologies if this information can be found somewhere else. I
couldn't find it anywhere on the internet.
Now to the real problem. I'm simply trying to utilize the boost libraries
(filesystem in particular) in my program. I'm just trying to even run the
example programs. I'm using Visual C++ 6.0 sp5.
I figured out how to compile it by including the directory where boost is. So
the example program compiles perfectly fine. Then the shit hits the fan, every
reference to any boost object gets an unresolved external error. I have no clue
why this is happening, and the most frustrating part is I cannot find
information anywhere on the internet on how to make it work. I find lots of
references telling me how great it is, but I cannot use it!
Dave
My compile output from visual c++ 6.0:
--------------------------------------------------------------------------------
Compiling...
path_test.cpp
Linking...
LINK : warning LNK4075: ignoring /INCREMENTAL due to /DEBUGTYPE specification
path_test.obj : error LNK2001: unresolved external symbol "public: __thiscall
boost::filesystem::path::path(class std::basic_string

Now to the real problem. I'm simply trying to utilize the boost libraries (filesystem in particular) in my program. I'm just trying to even run the example programs. I'm using Visual C++ 6.0 sp5. I figured out how to compile it by including the directory where boost is. So the example program compiles perfectly fine. Then the shit hits the fan, every reference to any boost object gets an unresolved external error. I have no clue why this is happening, and the most frustrating part is I cannot find information anywhere on the internet on how to make it work. I find lots of references telling me how great it is, but I cannot use it!
The filesystem lib has source code associated with it in libs/filesystem/src which has to be built to a static lib first, and then linked to your application. You can either use the bjam tool to build the library (consult the Boost documentation for that), or you can do it yourself from your IDE. John.

Yes, I've done that,
bjam "-sTOOLS=msvc"
and I just built them all. then when I tell MSVC that it should use the
filesystem.lib (or whatever the real name is) it tells me that I have multiple
declarations of the symbols.
Most likely I'm not setting up the IDE correctly. You just add it to the list of
libs to use and give it the correct path, yes? Thats all I did when I used SDL.
Thanks,
Dave
Quoting John Maddock
Now to the real problem. I'm simply trying to utilize the boost libraries (filesystem in particular) in my program. I'm just trying to even run the example programs. I'm using Visual C++ 6.0 sp5. I figured out how to compile it by including the directory where boost is. So the example program compiles perfectly fine. Then the shit hits the fan, every reference to any boost object gets an unresolved external error. I have no clue why this is happening, and the most frustrating part is I cannot find information anywhere on the internet on how to make it work. I find lots of references telling me how great it is, but I cannot use it!
The filesystem lib has source code associated with it in libs/filesystem/src which has to be built to a static lib first, and then linked to your application. You can either use the bjam tool to build the library (consult the Boost documentation for that), or you can do it yourself from your IDE.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_ ._ _ , _ ._ (_ ' ( ` )_ .__) ( ( ( ) `) ) _) (__ (_ (_ . _) _) ,__) `~~`\ ' . /`~~` ,::: ; ; :::, ':::::::::::::::' _____________/_ __ \____________ David Kowis Computer Programmer ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/

Yes, I've done that, bjam "-sTOOLS=msvc" and I just built them all. then when I tell MSVC that it should use the filesystem.lib (or whatever the real name is) it tells me that I have multiple declarations of the symbols.
You don't say what the errors are, but that usually happens if you build the lib against one runtime library (bjam builds against the dll runtime by default), and try and link your program against a different runtime. John.

Quoting John Maddock
You don't say what the errors are, but that usually happens if you build the lib against one runtime library (bjam builds against the dll runtime by default), and try and link your program against a different runtime.
John.
::_Copy(unsigned int)" (?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string
::basic_string
const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@QAE@ABV01@@Z) already defined in libcpd.lib(ios.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string ::append(class s
& __thiscall std::basic_string
::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string ::append(unsigne d int,char)" (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string ::append(char co nst *,unsigned int)" (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string ::assign(class s
Sorry about that, this time I've pasted the errors into this message. This is
telling it to use boost_filesystem.lib in the runtime directory that bjam
creates. I rebuilt the entire thing.
Is there another file I'm supposed to link to? I don't remember there ever being
a .dll file being built. If there is, I haven't found it yet. I'm pretty sure I
followed the bjam instructions really well. Also I'm just trying to use
boost::filesystem. That doesn't appear to make a dll.
I've set up my MSVC project to use D:\mp3dber\boost-1.30.2 as an include
directory. That's where I extracted the source and built it using bjam.
Thanks,
David
My compile errors:
Compiling...
path_test.cpp
Linking...
LINK : warning LNK4075: ignoring /INCREMENTAL due to /DEBUGTYPE specification
msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall
std::basic_string ::basic_string path_test.exe - 30 error(s), 2 warning(s)
_ ._ _ , _ ._
(_ ' ( ` )_ .__)
( ( ( ) `) ) _)
(__ (_ (_ . _) _) ,__)
`~~`\ ' . /`~~`
,::: ; ; :::,
':::::::::::::::'
_____________/_ __ \____________
David Kowis
Computer Programmer
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

Sorry about that, this time I've pasted the errors into this message. This is telling it to use boost_filesystem.lib in the runtime directory that bjam creates. I rebuilt the entire thing. Is there another file I'm supposed to link to? I don't remember there ever being a .dll file being built.
There isn't one for the filesystem lib.
If there is, I haven't found it yet. I'm pretty sure I followed the bjam instructions really well. Also I'm just trying to use boost::filesystem. That doesn't appear to make a dll. I've set up my MSVC project to use D:\mp3dber\boost-1.30.2 as an include directory. That's where I extracted the source and built it using bjam.
I've never seen errors like that: make doubly sure that if you are linking to the debug runtime then you should link to the debug filesystem lib, otherwise you could just add the filesystem source files (in libs/filesystem/src) directly to your project rather than the lib file. John.
participants (2)
-
David Kowis
-
John Maddock