CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Posts
    3

    Question How to shift VC6.0 projects to VC7.1???

    I have a simple project that works fine for VC 6.0, but when I updated my compiler to VC++ 7.1, and included the "mfc42d.lib"
    there are tons of link errors which I cannot figure out,

    But if I did not inlude mfc42d.lib, then link error " cannot open mfc42d.lib"!

    Any help will be greatly appreciated!!!

    James


    Linking...
    msvcrtd.lib(MSVCR71D.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
    msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
    msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info:perator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
    msvcrtd.lib(MSVCR71D.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
    atlsd.lib(atltypes.obj) : error LNK2005: "public: __thiscall CSize::CSize(void)" (??0CSize@@QAE@XZ) already defined in mfc42d.lib(MFC42D.DLL)

    ...... Tons of link errors!!!

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    Try commenting out the mfc42d.lib includes.

    What did you add it in the first place? An MFC project is linked to MFC libraries by default.

    Kuphryn

  3. #3
    Join Date
    Dec 2003
    Posts
    3
    First of all, the project works fine, compiling and linking, not problems at all for VC6.0.

    when I migrate my project from 6.0 to 7.1, I did not change anything, 7.1 did this automatically, but after it compiled and linked, it say" cannot open mfc42d.lib or mfc42.lib"
    for debug or release respectively.
    If I include that again, it poped up tons of link errors!

    James

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    [Moved thread]

  5. #5
    Join Date
    Oct 2002
    Posts
    209

    Re: How to shift VC6.0 projects to VC7.1???

    I have the same problem, does anyone know the solution?
    There is not an explicit include statement that I can remove.
    It tries to link automatically.

  6. #6
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: How to shift VC6.0 projects to VC7.1???

    Quote Originally Posted by clodagho
    I have the same problem, does anyone know the solution?
    There is not an explicit include statement that I can remove.
    It tries to link automatically.
    The problem is that a MFC application written in Visual Studio 6 includes MFC4.2 and on .NET you include MFC7. So they are interfering because both export the same symbols. It is recommended to remove any reference (library files, mfc4.2 specific headers) and use MFC7 instead.

    Best Regards
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured