473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Linker errors in VC7 when using RichEdit view

VC++ .NET 2003 Standard Edition
Win XP, SP2

Hi,

I have a code that builds under VC6.0, but fails to link in VC7.1.

The offending code is as follows:

_AFX_RICHEDIT_STATE* const pEditState = _afxRichEditState;

The linker errors are:

----------------------

LVBaseDetailsView.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) class CProcessLocal<class _AFX_RICHEDIT_STATE>
_afxRichEditState"
(__imp_?_afxRichEditState@@3V?$CProcessLocal@V_AFX _RICHEDIT_STATE@@@@A)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
virtual __thiscall _AFX_EDIT_STATE::~_AFX_EDIT_STATE(void)"
(??1_AFX_EDIT_STATE@@UAE@XZ) referenced in function $L153022

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
__thiscall _AFX_EDIT_STATE::_AFX_EDIT_STATE(void)"
(??0_AFX_EDIT_STATE@@QAE@XZ) referenced in function "public: static class
CNoTrackObject * __stdcall CProcessLocal<class
_AFX_RICHEDIT_STATE>::CreateObject(void)"
(?CreateObject@?$CProcessLocal@V_AFX_RICHEDIT_STAT E@@@@SGPAVCNoTrackObject@@XZ)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
virtual __thiscall _AFX_RICHEDIT_STATE::~_AFX_RICHEDIT_STATE(void)"
(??1_AFX_RICHEDIT_STATE@@UAE@XZ) referenced in function "public: virtual
void * __thiscall _AFX_RICHEDIT_STATE::`scalar deleting destructor'(unsigned
int)" (??_G_AFX_RICHEDIT_STATE@@UAEPAXI@Z)

----------------------

The code above is part of legacy code, which I am porting to the .NET
compiler. I cannot drastically change the code to do away with such things
since I saw in the code documentation that this was introduced to solve some
bug where the code crashes if a find dialog is opened in a RichEdit view.
When I searched MSDN / Google I found very little information regarding
this. Later I realized it may be because _afxRichEditState is an
undocumented class, derived from the undocumented CNoTrackObject.

Does anyone know of this problem and a solution to this?
Should I link to some library explicitly in VC7 .NET?

Warm regards,
Sena
Nov 17 '05 #1
2 3349
Ted
Unfortunately those symbols are no longer exported in the release version of
MFC71.DLL. They are only exported in the debug versions. I'm not sure if
this was an oversight on Microsoft's part or whether it was by design.

To verify this, you can do a "find in files" of afxRichEditState in the DEF
files in the installation folders. Notice under VC6.0 it shows up under
both the debug and release DEF files. Under 7.1 it only shows in the debug
DEF files.

The fix you talked about is already fixed in VC7.1, so maybe you could
change your code back to using the standard rich edit control, and not your
own copy. Or to properly fix the problem, bring in all the definitions of
the classes you need (copy them in)

Ted.

"Senapathy" <Se***************@siemens.com> wrote in message
news:d9**********@news.mch.sbs.de...
VC++ .NET 2003 Standard Edition
Win XP, SP2

Hi,

I have a code that builds under VC6.0, but fails to link in VC7.1.

The offending code is as follows:

_AFX_RICHEDIT_STATE* const pEditState = _afxRichEditState;

The linker errors are:

----------------------

LVBaseDetailsView.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) class CProcessLocal<class _AFX_RICHEDIT_STATE>
_afxRichEditState"
(__imp_?_afxRichEditState@@3V?$CProcessLocal@V_AFX _RICHEDIT_STATE@@@@A)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
virtual __thiscall _AFX_EDIT_STATE::~_AFX_EDIT_STATE(void)"
(??1_AFX_EDIT_STATE@@UAE@XZ) referenced in function $L153022

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
__thiscall _AFX_EDIT_STATE::_AFX_EDIT_STATE(void)"
(??0_AFX_EDIT_STATE@@QAE@XZ) referenced in function "public: static class
CNoTrackObject * __stdcall CProcessLocal<class
_AFX_RICHEDIT_STATE>::CreateObject(void)"
(?CreateObject@?$CProcessLocal@V_AFX_RICHEDIT_STAT E@@@@SGPAVCNoTrackObject@@XZ)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol "public:
virtual __thiscall _AFX_RICHEDIT_STATE::~_AFX_RICHEDIT_STATE(void)"
(??1_AFX_RICHEDIT_STATE@@UAE@XZ) referenced in function "public: virtual
void * __thiscall _AFX_RICHEDIT_STATE::`scalar deleting
destructor'(unsigned int)" (??_G_AFX_RICHEDIT_STATE@@UAEPAXI@Z)

----------------------

The code above is part of legacy code, which I am porting to the .NET
compiler. I cannot drastically change the code to do away with such things
since I saw in the code documentation that this was introduced to solve
some bug where the code crashes if a find dialog is opened in a RichEdit
view.
When I searched MSDN / Google I found very little information regarding
this. Later I realized it may be because _afxRichEditState is an
undocumented class, derived from the undocumented CNoTrackObject.

Does anyone know of this problem and a solution to this?
Should I link to some library explicitly in VC7 .NET?

Warm regards,
Sena

Nov 17 '05 #2
Hi Ted,

Thanks for the info ! I too finally resorted to commenting out the offending
code to get it built, but didn't know if it was alright.
Can you point out for me if it is documented somewhere that the original bug
in RichEdit view is fixed in VC7.1?
( just to appease the Q guys if they ask how I can comment out code
arbitrarily during porting to .NET compiler! )

Regards,
Sena

"Ted" <te*@t--x.org> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Unfortunately those symbols are no longer exported in the release version
of MFC71.DLL. They are only exported in the debug versions. I'm not
sure if this was an oversight on Microsoft's part or whether it was by
design.

To verify this, you can do a "find in files" of afxRichEditState in the
DEF files in the installation folders. Notice under VC6.0 it shows up
under both the debug and release DEF files. Under 7.1 it only shows in
the debug DEF files.

The fix you talked about is already fixed in VC7.1, so maybe you could
change your code back to using the standard rich edit control, and not
your own copy. Or to properly fix the problem, bring in all the
definitions of the classes you need (copy them in)

Ted.

"Senapathy" <Se***************@siemens.com> wrote in message
news:d9**********@news.mch.sbs.de...
VC++ .NET 2003 Standard Edition
Win XP, SP2

Hi,

I have a code that builds under VC6.0, but fails to link in VC7.1.

The offending code is as follows:

_AFX_RICHEDIT_STATE* const pEditState = _afxRichEditState;

The linker errors are:

----------------------

LVBaseDetailsView.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) class CProcessLocal<class _AFX_RICHEDIT_STATE>
_afxRichEditState"
(__imp_?_afxRichEditState@@3V?$CProcessLocal@V_AFX _RICHEDIT_STATE@@@@A)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol
"public: virtual __thiscall _AFX_EDIT_STATE::~_AFX_EDIT_STATE(void)"
(??1_AFX_EDIT_STATE@@UAE@XZ) referenced in function $L153022

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol
"public: __thiscall _AFX_EDIT_STATE::_AFX_EDIT_STATE(void)"
(??0_AFX_EDIT_STATE@@QAE@XZ) referenced in function "public: static class
CNoTrackObject * __stdcall CProcessLocal<class
_AFX_RICHEDIT_STATE>::CreateObject(void)"
(?CreateObject@?$CProcessLocal@V_AFX_RICHEDIT_STAT E@@@@SGPAVCNoTrackObject@@XZ)

LVBaseDetailsView.obj : error LNK2019: unresolved external symbol
"public: virtual __thiscall
_AFX_RICHEDIT_STATE::~_AFX_RICHEDIT_STATE(void)"
(??1_AFX_RICHEDIT_STATE@@UAE@XZ) referenced in function "public: virtual
void * __thiscall _AFX_RICHEDIT_STATE::`scalar deleting
destructor'(unsigned int)" (??_G_AFX_RICHEDIT_STATE@@UAEPAXI@Z)

----------------------

The code above is part of legacy code, which I am porting to the .NET
compiler. I cannot drastically change the code to do away with such
things since I saw in the code documentation that this was introduced to
solve some bug where the code crashes if a find dialog is opened in a
RichEdit view.
When I searched MSDN / Google I found very little information regarding
this. Later I realized it may be because _afxRichEditState is an
undocumented class, derived from the undocumented CNoTrackObject.

Does anyone know of this problem and a solution to this?
Should I link to some library explicitly in VC7 .NET?

Warm regards,
Sena


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
3
by: Grahamo | last post by:
Hi, I have a question that pertains to Templates and link time. This is totally for my own understanding and to correct what's obviously an erroneous view of things on my behalf; Lets say I...
4
by: Senapathy | last post by:
VC++ .NET 2003 Standard Edition Win XP, SP2 Hi, I have a code that builds under VC6.0, but fails to link in VC7.1. The offending code is as follows: _AFX_RICHEDIT_STATE* const pEditState...
3
by: ac2806 | last post by:
Hi I want to use the static MFC within a dll, but I get the following errors when linking: nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcwd.lib(appcore.obj)...
3
by: ralphsieminsky | last post by:
A project compiles fine under VS 2005 RC without the /clr option. However, when /clr is turned on several errors appear: - A symbol exported from a DLL is not found by another DLL referencing...
3
by: Chucker | last post by:
Hi Folks, I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this worked fine. When moving to .NET 2.0 I get a couple of unresolved externals / linker errors: Error 16 error...
0
by: VivekR | last post by:
I have a MFC application developed using VC++ 5. Recently I ported that to VC++ 7.1 and now I am trying to compile the MFC application with /CLR under VC++ 7.1. And I get linker errors referring to...
1
by: Claire | last post by:
I'm writing an application with custom skinned controls. I have a text editor form with a rich edit control. Because there's no toolbuttons in the skinned control set, I have to use normal ones for...
2
by: Markus Dehmann | last post by:
What to do if an external library is header-files-only (but you have to use it), and you get lots of linker errors? You will necessarily get linker errors "multiple definition of ..." if you try...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.