Linker errors in VC7 when using RichEdit view

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Senapathy

    #1

    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_S TATE* const pEditState = _afxRichEditSta te;

    The linker errors are:

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

    LVBaseDetailsVi ew.obj : error LNK2001: unresolved external symbol
    "__declspec(dll import) class CProcessLocal<c lass _AFX_RICHEDIT_S TATE>
    _afxRichEditSta te"
    (__imp_?_afxRic hEditState@@3V? $CProcessLocal@ V_AFX_RICHEDIT_ STATE@@@@A)

    LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    virtual __thiscall _AFX_EDIT_STATE ::~_AFX_EDIT_ST ATE(void)"
    (??1_AFX_EDIT_S TATE@@UAE@XZ) referenced in function $L153022

    LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    __thiscall _AFX_EDIT_STATE ::_AFX_EDIT_STA TE(void)"
    (??0_AFX_EDIT_S TATE@@QAE@XZ) referenced in function "public: static class
    CNoTrackObject * __stdcall CProcessLocal<c lass
    _AFX_RICHEDIT_S TATE>::CreateOb ject(void)"
    (?CreateObject@ ?$CProcessLocal @V_AFX_RICHEDIT _STATE@@@@SGPAV CNoTrackObject@ @XZ)

    LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    virtual __thiscall _AFX_RICHEDIT_S TATE::~_AFX_RIC HEDIT_STATE(voi d)"
    (??1_AFX_RICHED IT_STATE@@UAE@X Z) referenced in function "public: virtual
    void * __thiscall _AFX_RICHEDIT_S TATE::`scalar deleting destructor'(uns igned
    int)" (??_G_AFX_RICHE DIT_STATE@@UAEP AXI@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 _afxRichEditSta te 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


  • Ted

    #2
    Re: Linker errors in VC7 when using RichEdit view

    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 afxRichEditStat e 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" <Senapathy.Knos pam@siemens.com > wrote in message
    news:d9qog3$t13 $1@news.mch.sbs .de...[color=blue]
    > 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_S TATE* const pEditState = _afxRichEditSta te;
    >
    > The linker errors are:
    >
    > ----------------------
    >
    > LVBaseDetailsVi ew.obj : error LNK2001: unresolved external symbol
    > "__declspec(dll import) class CProcessLocal<c lass _AFX_RICHEDIT_S TATE>
    > _afxRichEditSta te"
    > (__imp_?_afxRic hEditState@@3V? $CProcessLocal@ V_AFX_RICHEDIT_ STATE@@@@A)
    >
    > LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    > virtual __thiscall _AFX_EDIT_STATE ::~_AFX_EDIT_ST ATE(void)"
    > (??1_AFX_EDIT_S TATE@@UAE@XZ) referenced in function $L153022
    >
    > LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    > __thiscall _AFX_EDIT_STATE ::_AFX_EDIT_STA TE(void)"
    > (??0_AFX_EDIT_S TATE@@QAE@XZ) referenced in function "public: static class
    > CNoTrackObject * __stdcall CProcessLocal<c lass
    > _AFX_RICHEDIT_S TATE>::CreateOb ject(void)"
    > (?CreateObject@ ?$CProcessLocal @V_AFX_RICHEDIT _STATE@@@@SGPAV CNoTrackObject@ @XZ)
    >
    > LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol "public:
    > virtual __thiscall _AFX_RICHEDIT_S TATE::~_AFX_RIC HEDIT_STATE(voi d)"
    > (??1_AFX_RICHED IT_STATE@@UAE@X Z) referenced in function "public: virtual
    > void * __thiscall _AFX_RICHEDIT_S TATE::`scalar deleting
    > destructor'(uns igned int)" (??_G_AFX_RICHE DIT_STATE@@UAEP AXI@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 _afxRichEditSta te 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
    >[/color]


    Comment

    • Senapathy

      #3
      Re: Linker errors in VC7 when using RichEdit view

      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" <ted@t--x.org> wrote in message
      news:%23TiyNR$e FHA.344@TK2MSFT NGP10.phx.gbl.. .[color=blue]
      > 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 afxRichEditStat e 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" <Senapathy.Knos pam@siemens.com > wrote in message
      > news:d9qog3$t13 $1@news.mch.sbs .de...[color=green]
      >> 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_S TATE* const pEditState = _afxRichEditSta te;
      >>
      >> The linker errors are:
      >>
      >> ----------------------
      >>
      >> LVBaseDetailsVi ew.obj : error LNK2001: unresolved external symbol
      >> "__declspec(dll import) class CProcessLocal<c lass _AFX_RICHEDIT_S TATE>
      >> _afxRichEditSta te"
      >> (__imp_?_afxRic hEditState@@3V? $CProcessLocal@ V_AFX_RICHEDIT_ STATE@@@@A)
      >>
      >> LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol
      >> "public: virtual __thiscall _AFX_EDIT_STATE ::~_AFX_EDIT_ST ATE(void)"
      >> (??1_AFX_EDIT_S TATE@@UAE@XZ) referenced in function $L153022
      >>
      >> LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol
      >> "public: __thiscall _AFX_EDIT_STATE ::_AFX_EDIT_STA TE(void)"
      >> (??0_AFX_EDIT_S TATE@@QAE@XZ) referenced in function "public: static class
      >> CNoTrackObject * __stdcall CProcessLocal<c lass
      >> _AFX_RICHEDIT_S TATE>::CreateOb ject(void)"
      >> (?CreateObject@ ?$CProcessLocal @V_AFX_RICHEDIT _STATE@@@@SGPAV CNoTrackObject@ @XZ)
      >>
      >> LVBaseDetailsVi ew.obj : error LNK2019: unresolved external symbol
      >> "public: virtual __thiscall
      >> _AFX_RICHEDIT_S TATE::~_AFX_RIC HEDIT_STATE(voi d)"
      >> (??1_AFX_RICHED IT_STATE@@UAE@X Z) referenced in function "public: virtual
      >> void * __thiscall _AFX_RICHEDIT_S TATE::`scalar deleting
      >> destructor'(uns igned int)" (??_G_AFX_RICHE DIT_STATE@@UAEP AXI@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 _afxRichEditSta te 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
      >>[/color]
      >
      >[/color]


      Comment

      Working...