lbcmt.lib reports missing std::exception in VS 2005 prof.

D

Darko Miletic

Recently I wrote a dll in c++ and to simplify the distribution I decided
to link with multithreaded static library (/MT or /MTd option). In debug
everything works fine but in release I get this:

parseMetadata.obj : error LNK2001: unresolved external symbol "public:
__thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(void)"
(??0exception@std@@QAE@XZ)
2>parseMetadata.obj : error LNK2001: unresolved external symbol "public:
__thiscall std::exception::exception(char const * const &)"
(??0exception@std@@QAE@ABQBD@Z)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const &)"
(??0exception@std@@QAE@ABQBD@Z)
2>libcpmt.lib(locale0.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(char const * const &)"
(??0exception@std@@QAE@ABQBD@Z)
2>parseMetadata.obj : error LNK2001: unresolved external symbol "public:
__thiscall std::exception::exception(class std::exception const &)"
(??0exception@std@@QAE@ABV01@@Z)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception const
&)" (??0exception@std@@QAE@ABV01@@Z)
2>libcpmt.lib(locale0.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception const
&)" (??0exception@std@@QAE@ABV01@@Z)
2>parseMetadata.obj : error LNK2001: unresolved external symbol "public:
virtual __thiscall std::exception::~exception(void)"
(??1exception@std@@UAE@XZ)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)"
(??1exception@std@@UAE@XZ)
2>libcpmt.lib(locale0.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)"
(??1exception@std@@UAE@XZ)
2>parseMetadata.obj : error LNK2001: unresolved external symbol "public:
virtual char const * __thiscall std::exception::what(void)const "
(?what@exception@std@@UBEPBDXZ)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)const
" (?what@exception@std@@UBEPBDXZ)
2>libcpmt.lib(locale0.obj) : error LNK2001: unresolved external symbol
"public: virtual char const * __thiscall std::exception::what(void)const
" (?what@exception@std@@UBEPBDXZ)

This does not make much sense to me? Is that a bug? Do I need service
pack or something else?
 
C

Carl Daniel [VC++ MVP]

Darko Miletic said:
Recently I wrote a dll in c++ and to simplify the distribution I decided
to link with multithreaded static library (/MT or /MTd option). In debug
everything works fine but in release I get this:

[errors snipped]
This does not make much sense to me? Is that a bug? Do I need service pack
or something else?

It sounds like the C++ runtime library (libcpmt.lib) wasn't linked for some
reason. Another possibility is that you have multiple versions of VC++
installed, and the linker is linking the wrong library.

You could try adding /verbose to your linker options to see exactly what's
going on in either case.

-cd
 
D

Darko Miletic

Carl said:
It sounds like the C++ runtime library (libcpmt.lib) wasn't linked for some
reason. Another possibility is that you have multiple versions of VC++
installed, and the linker is linking the wrong library.

You where right. I did have multiple versions of libcpmt.lib and
compiler used the wrong one. Thank you for your help :)

Darko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top