linkage errors in release build with VS2005

2

2b|!2b==?

I am having linkage errors in my release build as ff:

------ Build started: Project: myModule, Configuration: Release Win32 ------
Linking...
Creating library c:\mypath\myModule.lib and object
c:\mypath\myModule.exp
Class1.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
Class2.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
Class3.obj : error LNK2019: unresolved external symbol
__imp___CrtDbgReportW referenced in function "public: void __thiscall
std::list<class MsgConnect::MCQueue *,class std::allocator<class
MsgConnect::MCQueue *> >::_Const_iterator<1>::_Compat(class
std::list<class MsgConnect::MCQueue *,class std::allocator<class
MsgConnect::MCQueue *> >::_Const_iterator<1> const &)const "
(?_Compat@?$_Const_iterator@$00@?$list@PAVMCQueue@MsgConnect@@V?$allocator@PAVMCQueue@MsgConnect@@@std@@@std@@QBEXABV123@@Z)
Class4.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
Class5.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
Class6.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
c:\mypath\myModule.dll : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\mypath\BuildLog.htm"
myModule - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If I use the CRT Debug Dll in my "C++ code generation" setting, the
errors go away - (but ofcourse, there is the warning of multiple defined
symbols) - also this is not pratical - i.e. will lead to run time
crashes, since I cannot mix Debug dll and release dlls are memory is
allocated differently between the two.

Anyione come accross this before - and whats the correct solution to this?
 
B

Ben Voigt

2b|!2b==? said:
I am having linkage errors in my release build as ff:

------ Build started: Project: myModule, Configuration: Release
Win32 ------
Linking...
Creating library c:\mypath\myModule.lib and object
c:\mypath\myModule.exp
Class1.obj : error LNK2001: unresolved external symbol
__imp___CrtDbgReportW
Class2.obj : error LNK2001: unresolved external symbol
__imp___CrtDbgReportW
Class3.obj : error LNK2019: unresolved external symbol
__imp___CrtDbgReportW referenced in function "public: void __thiscall
std::list<class MsgConnect::MCQueue *,class std::allocator<class
MsgConnect::MCQueue *> >::_Const_iterator<1>::_Compat(class
std::list<class MsgConnect::MCQueue *,class std::allocator<class
MsgConnect::MCQueue *> >::_Const_iterator<1> const &)const "
(?_Compat@?$_Const_iterator@$00@?$list@PAVMCQueue@MsgConnect@@V?$allocator@PAVMCQueue@MsgConnect@@@std@@@std@@QBEXABV123@@Z)
Class4.obj : error LNK2001: unresolved external symbol
__imp___CrtDbgReportW
Class5.obj : error LNK2001: unresolved external symbol
__imp___CrtDbgReportW
Class6.obj : error LNK2001: unresolved external symbol
__imp___CrtDbgReportW
c:\mypath\myModule.dll : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\mypath\BuildLog.htm"
myModule - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========

If I use the CRT Debug Dll in my "C++ code generation" setting, the errors
go away - (but ofcourse, there is the warning of multiple defined
symbols) - also this is not pratical - i.e. will lead to run time crashes,
since I cannot mix Debug dll and release dlls are memory is allocated
differently between the two.

Anyione come accross this before - and whats the correct solution to this?


One of your files (or static library) is compiled with _DEBUG defined. Make
sure you aren't linking a debug static library with your release build.
 
2

2b|!2b==?

Ben said:
One of your files (or static library) is compiled with _DEBUG defined. Make
sure you aren't linking a debug static library with your release build.
Thanks for that - I don't know how on earth I missed that - I still had
a _DEBUG defined in the release config :(
 

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