
Hi there, I'm getting linker errors when I'm trying to compile my application with VS.2003 and boost-1.32. The application uses a DLL which doesn't use parts of the STL or boost, only the application itself and a static library (which contains the major parts of the code) are using boost, STL and MFC code. mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)', verwiesen in Funktion '"public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall MemoryInfo::getTotalRam(void)const " (?getTotalRam@MemoryInfo@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$all ocator@D@2@@std@@XZ)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) mfcie error LNK2001: Nichtaufgelöstes externes Symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z)', verwiesen in Funktion '"public: virtual void __thiscall DriveInfo::determineDriveInfo(unsigned int const &)" (?determineDriveInfo@DriveInfo@@UAEXABI@Z)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z)', verwiesen in Funktion '"protected: virtual void __thiscall OSInfo::determineOSInfo(void)" (?determineOSInfo@OSInfo@@MAEXXZ)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z)', verwiesen in Funktion '"public: virtual void __thiscall DriveInfo::determineDriveInfo(unsigned int const &)" (?determineDriveInfo@DriveInfo@@UAEXABI@Z)' mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) bool __cdecl std::operator==(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> > const &)" (__imp_??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2 @@0@0@Z)', verwiesen in Funktion '"public: enum CpuStats::e_CPUVENDORS __thiscall CpuStats::getVendor(void)const " (?getVendor@CpuStats@@QBE?AW4e_CPUVENDORS@1@XZ)' mfcie fatal error LNK1120: 4 unaufgelöste externe Verweise
Any ideas? Greetings Andrew

Hi Andreas, Not sure this problem has something to do with Boost (if it has at all, I believe it's something for the boost.user list). I cannot tell you what exactly goes wrong, due to the lack of information (verbose linker output, command line of invocation). The right C++ standard library isn't loaded by the linker. This can have the following reasons: - You are linking the program (or your static library) with a static runtime library but a library you are using does want to link with a dynamic one (the __imp prefix indicates a missing import library). In this case make sure to set the right runtime-linkage while building boost. - You are invoking the linker with NODEFAULTLIB(S) options or NODEFAULTLIB options have been toasted into a static library you are trying to use (via #pragma). I can't imagine boost developers doing things like this - but I've met (non-boost) libraries with the "little bit of extra-horror" inside ;-). - The default calling convention used by the standard library differs from the one used to build the program (or your static library), so the inlined code tries to call a routine which is not there. However, '__cdecl' looks OK, unless you recompiled your standard C++ library. (I might have forgotten something.) Verbose linking is a good idea to track down the problem. Greetings, Tobias Andreas Löffler wrote:
Hi there,
I'm getting linker errors when I'm trying to compile my application with VS.2003 and boost-1.32. The application uses a DLL which doesn't use parts of the STL or boost, only the application itself and a static library (which contains the major parts of the code) are using boost, STL and MFC code.
mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)', verwiesen in Funktion '"public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall MemoryInfo::getTotalRam(void)const " (?getTotalRam@MemoryInfo@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$all ocator@D@2@@std@@XZ)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) mfcie error LNK2001: Nichtaufgelöstes externes Symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_str ing@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z)', verwiesen in Funktion '"public: virtual void __thiscall DriveInfo::determineDriveInfo(unsigned int const &)" (?determineDriveInfo@DriveInfo@@UAEXABI@Z)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,char const *)"
(__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z)', verwiesen in Funktion '"protected: virtual void __thiscall OSInfo::determineOSInfo(void)" (?determineOSInfo@OSInfo@@MAEXXZ)' mfcie error LNK2001: Nichtaufgelöstes externes Symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
&,char const *)"
(__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char)" (__imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z)', verwiesen in Funktion '"public: virtual void __thiscall DriveInfo::determineDriveInfo(unsigned int const &)" (?determineDriveInfo@DriveInfo@@UAEXABI@Z)' mfcie error LNK2019: Nicht aufgelöstes externes Symbol '"__declspec(dllimport) bool __cdecl std::operator==(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> > const &)" (__imp_??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2 @@0@0@Z)', verwiesen in Funktion '"public: enum CpuStats::e_CPUVENDORS __thiscall CpuStats::getVendor(void)const " (?getVendor@CpuStats@@QBE?AW4e_CPUVENDORS@1@XZ)' mfcie fatal error LNK1120: 4 unaufgelöste externe Verweise
Any ideas?
Greetings Andrew
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Andreas Löffler
-
Tobias Schwinger