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<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0path@filesystem@boost@@QAE@ABV?$basic_s tring@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) path_test.obj : error LNK2001: unresolved external symbol "public: __thiscall boost::filesystem::path::path(char const *,enum boost::filesystem::path_format)" (??0path@filesystem@boost@@QAE@PBDW4path_format@12@@Z) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::is_complete(void)const " (?is_complete@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::has_branch_path(void)const " (?has_branch_path@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::has_relative_path(void)const " (?has_relative_path@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::has_root_directory(void)const " (?has_root_directory@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::has_root_name(void)const " (?has_root_name@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::filesystem::path::has_root_path(void)const " (?has_root_path@path@filesystem@boost@@QBE_NXZ) path_test.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path __thiscall boost::filesystem::path::root_path(void)const " (?root_path@path@filesystem@boost@@QBE?AV123@XZ) path_test.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> path_test.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> path_test.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path __thiscall boost::filesystem::path::relative_path(void)const " (?relative_path@path@filesystem@boost@@QBE?AV123@XZ) path_test.obj : error LNK2001: unresolved external symbol "public: struct boost::iterator_adaptor<struct boost::filesystem::detail::path_itr_imp,struct boost::default_iterator_policies,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> path_test.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::filesystem::boost_directory_name(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?boost_directory_name@filesystem@boost @@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) path_test.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::filesystem::boost_file_name(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?boost_file_name@filesystem@boost@@YA_NABV? $basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) path_test.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::filesystem::posix_name(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?posix_name@filesystem@boost@@YA_NABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) path_test.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path __thiscall boost::filesystem::path::branch_path(void)const " (?branch_path@path@filesystem@boost@@QBE?AV123@XZ) path_test.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> path_test.obj : error LNK2001: unresolved external symbol "class boost::filesystem::path const & __cdecl boost::filesystem::check_posix_leaf(class boost::filesystem::path const &)" (?check_posix_leaf@filesystem@boost@@YAABVpath@12@ABV312@@Z) path_test.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::filesystem::exists(class boost::filesystem::path const &)" (?exists@filesystem@boost@@YA_NABVpath@12@@Z) path_test.obj : error LNK2001: unresolved external symbol "public: __thiscall boost::filesystem::path::path(char const *)" (??0path@filesystem@boost@@QAE@PBD@Z) path_test.obj : error LNK2001: unresolved external symbol "public: class boost::filesystem::path & __thiscall boost::filesystem::path::operator/=(class boost::filesystem::path const &)" (??_0path@filesystem@boost@@QAEAAV012@ABV012@@Z) path_test.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::filesystem::detail::path_itr_imp::operator++(void)" (??Epath_itr_imp@detail@filesystem@boost@@QAEXXZ) path_test.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::filesystem::detail::path_itr_imp::operator--(void)" (??Fpath_itr_imp@detail@filesystem@boost@@QAEXXZ) Debug/path_test.exe : fatal error LNK1120: 24 unresolved externals Error executing link.exe. path_test.exe - 25 error(s), 1 warning(s) _ ._ _ , _ ._ (_ ' ( ` )_ .__) ( ( ( ) `) ) _) (__ (_ (_ . _) _) ,__) `~~`\ ' . /`~~` ,::: ; ; :::, ':::::::::::::::' _____________/_ __ \____________ David Kowis Computer Programmer ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
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 <john@johnmaddock.co.uk>:
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 <john@johnmaddock.co.uk>:
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<char,struct std::char_traits<char>,class std::allocator<char> ::_Tidy(bool)" (?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z) alread y defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@st d@@QBEIXZ) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "void __cdecl std::_Xlen(void)" (?_Xlen@std@@YAXXZ) already defined in libcpd.lib(string.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ::_Eos(unsigned int)" (?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) a lready defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "private: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE _NI_N@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "bool __cdecl std::operator!=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> const &,char const *)" (??9std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator @D@2@@0@PBD@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> (void)" (??1?$basic_string@ DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in
::basic_string<char,struct std::char_traits<char>,class std::allocator<char> (class std::basic_string<cha r,struct std::char_traits<char>,class std::allocator<char> > 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<char,struct std::char_traits<char>,class std::allocator<char> & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::append(class s
& __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::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<char,struct std::char_traits<char>,class std::allocator<char> ::_Freeze(void)" (?_Freeze@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ) alre ady defined in libcpd.lib(iostream.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::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<char,struct std::char_traits<char>,class std::allocator<char> & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::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<char,struct std::char_traits<char>,class std::allocator<char> ::_Split(void)" (?_Split@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ) alread y defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "void __cdecl std::_Xran(void)" (?_Xran@std@@YAXXZ) already defined in libcpd.lib(string.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::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<char,struct std::char_traits<char>,class std::allocator<char> path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall std::runtime_error::~runtime_error(void)" (??1runtime_error@std@@UAE@XZ) already defined in libcpd.lib(ios.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> td::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in libcpd.lib(locale.obj) msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> td::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
::basic_string<char,struct std::char_traits<char>,class std::allocator<char> (class std::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::assign(char co nst *,unsigned int)" (?assign@?$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: "bool __cdecl std::operator==(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> const &,char const *)" (??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator @D@2@@0@PBD@Z) already defined in path_test.obj msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ::basic_string<char,struct std::char_traits<char>,class std::allocator<char> (char const *,class std::all ocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in path_test.obj MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memchr already defined in LIBCD.lib(memchr.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBCD.lib(stdexcpt.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBCD.lib(stdexcpt.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) already defined in LIBCD.lib(typinfo.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) already defined in LIBCD.lib(stdexcpt.obj) LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library Debug/path_test.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe.
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