Connecting Tech Pros Worldwide Forums | Help | Site Map

linkage errors in release build with VS2005

2b|!2b==?
Guest
 
Posts: n/a
#1: Mar 29 '07
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<1const &)const "
(?_Compat@?$_Const_iterator@$00@?$list@PAVMCQueue@ MsgConnect@@V?$allocator@PAVMCQueue@MsgConnect@@@s td@@@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?

Ben Voigt
Guest
 
Posts: n/a
#2: Mar 30 '07

re: linkage errors in release build with VS2005



"2b|!2b==?" <root@your.box.comwrote in message
news:6dWdnbyY5LqpZpfbnZ2dnUVZ8t2snZ2d@bt.com...
Quote:
>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<1const &)const "
(?_Compat@?$_Const_iterator@$00@?$list@PAVMCQueue@ MsgConnect@@V?$allocator@PAVMCQueue@MsgConnect@@@s td@@@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.


2b|!2b==?
Guest
 
Posts: n/a
#3: Mar 30 '07

re: linkage errors in release build with VS2005




Ben Voigt wrote:
Quote:
"2b|!2b==?" <root@your.box.comwrote in message
news:6dWdnbyY5LqpZpfbnZ2dnUVZ8t2snZ2d@bt.com...
>
Quote:
>>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<1const &)const "
>>(?_Compat@?$_Const_iterator@$00@?$list@PAVMCQueu e@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.
>
>
Thanks for that - I don't know how on earth I missed that - I still had
a _DEBUG defined in the release config :(
Closed Thread


Similar .NET Framework bytes