Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2005-01-22 10:46:02


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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@ABV?$basic_str
> ing_at_DU?$char_traits_at_D@std@@V?$allocator_at_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_at_MemoryInfo@@QBE?AV?$basic_string_at_DU?$char_traits_at_D@std@@V?$all
> ocator_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@ABV?$basic_str
> ing_at_DU?$char_traits_at_D@std@@V?$allocator_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@ABV?$basic_str
> ing_at_DU?$char_traits_at_D@std@@V?$allocator_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@PBD_at_Z)',
> verwiesen in Funktion '"public: virtual void __thiscall
> DriveInfo::determineDriveInfo(unsigned int const &)"
> (?determineDriveInfo_at_DriveInfo@@UAEXABI_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@PBD_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@PBD_at_Z)',
> verwiesen in Funktion '"protected: virtual void __thiscall
> OSInfo::determineOSInfo(void)" (?determineOSInfo_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@PBD_at_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_at_DU?$char_traits_at_D@std@@@0_at_AAV10@D_at_Z)',
> verwiesen in Funktion '"public: virtual void __thiscall
> DriveInfo::determineDriveInfo(unsigned int const &)"
> (?determineDriveInfo_at_DriveInfo@@UAEXABI_at_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_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2
> @@0_at_0@Z)', verwiesen in Funktion '"public: enum CpuStats::e_CPUVENDORS
> __thiscall CpuStats::getVendor(void)const "
> (?getVendor_at_CpuStats@@QBE?AW4e_CPUVENDORS_at_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
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk