-
September 6th, 2005, 02:10 PM
#1
Linker error with CString only in debug
vc 7.0 env.
I have a exported method that takes a CString as a param. The project that calls this method generates a unresolved external only in dubug. In release its ok.
If I add a wrapper method that takes a LPCTSTR instead of the CString it works.
The actual error is:
clSelectProjectDlg.obj : error LNK2019: unresolved external symbol "public: void __thiscall clFieldDefinition::Name(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > const &)" (?Name@clFieldDefinition@@QAEXABV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function "long __cdecl ConvertField(class clFieldDefinition &,struct IField *)" (?ConvertField@@YAJAAVclFieldDefinition@@PAUIField@@@Z)
ISDesktopAccess.obj : error LNK2001: unresolved external symbol "public: void __thiscall clFieldDefinition::Name(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > const &)" (?Name@clFieldDefinition@@QAEXABV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
TaskPusherCtrl.obj : error LNK2001: unresolved external symbol "public: void __thiscall clFieldDefinition::Name(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > const &)" (?Name@clFieldDefinition@@QAEXABV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
anyone seen this error before? if so what is the cause and resolution
and Canada rocks!! Peace bro.
-
September 6th, 2005, 06:34 PM
#2
Re: Linker error with CString only in debug
See if this information is helpful:
LNK2019
LNK2001
Linker errors similar to this used to cause me numerous headaches using previous versions of VC++. They were notoriously difficult to track down and fix. They usually turned out to be problems with how I created the initial project. Some how I was getting the single-threaded libraries mixed up with the multi-threaded ones, and the debug libraries mixed up with the release libraries. The easy fix was to link the release version statically to the MFC libraries. This also avoided problems we were having with DLL H***.
I don't know if this helps you or not. I haven't really used VC++ 7.0, so I don't know if these same problems are still issues.
-
September 7th, 2005, 05:24 AM
#3
Re: Linker error with CString only in debug
You need to create an MFC Extension dll if you are using MFC or if using the ATL CString implementation you need to try the steps outlined here
http://support.microsoft.com/default...b;EN-US;168958
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
-
September 7th, 2005, 10:32 AM
#4
Re: Linker error with CString only in debug
Thanks to all.
But why do I only get error in debug build???
and Canada rocks!! Peace bro.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|