CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    29

    Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Hi...

    I am trying to migrate a large MFC solution from VS2005 to VS2015. The solution contains 170 projects. After a lot of work, all projects compile and 168 of them link. One that does not link is petty, but pesky, and I may return to that in another post. The other that does not link is the project that generates the program executable.

    * The error that it generates is LNK1104: Cannot Open 'mfc80d.lib'.
    * If I ignore MFC80d.lib, I get LNK1104: Cannot Open 'mfcs80d.lib'.
    * If I ignore that, I get LNK1104: Cannot Open 'daouuid.lib'
    * And if I ignore that, I get any number of undefined externals such as CRect::...(), CSize::...(), CFile::...() and so on. This is presumably because I am not linking MFC at all.

    I have found a lot of discussion about this but none of it seems to help me. I can find no explicit or implicit references to MFC 8 in my properties or any project file. My target platform is 8.1 and my platform toolset is 140.

    Can anyone offer any suggestion?
    If I may slip in a second question, do I need to worry about migrating DAO?

    Thank you very much for any help that you can offer.

    FF

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,923

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    I can find no explicit or implicit references to MFC 8 in my properties or any project file.
    Have a look at this https://msdn.microsoft.com/en-us/library/bx5yfk7t.aspx
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    Join Date
    Feb 2008
    Posts
    29

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Quote Originally Posted by 2kaud View Post
    Thanks for the link. I will look into this and let you know.

    FF

  4. #4
    Join Date
    Feb 2008
    Posts
    29

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Quote Originally Posted by 2kaud View Post
    I have searched the Visual Studio headers as suggested by the link. The only explicit references to selecting MFC libraries are nested under #ifndef _AFX_NOFORCE_LIBS. Apparently _AFX_NOFORCE_LIBS is defined somewhere since the code is disabled. _AFX_NOFORCE_LIBS seems to relate to linking both MFC and CLR. I am not linking CLR since I don't have .NET functionality in the project. I have also tried to explicitly add the /defaultlib directive to the linker command line. It does not appear to be a recognized directive. I will continue to fight with this and hope for a reply. I

    FF

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    What happens when you compile in release mode?

  6. #6
    Join Date
    Feb 2008
    Posts
    29

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Quote Originally Posted by Arjay View Post
    What happens when you compile in release mode?
    Thanks for asking. I have been thinking about that too. It will take some days of work to get the release build configured throughout the solution. I will work towards that and let you know. Of course, I will still need to get the debug builds working.

    FF

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Quote Originally Posted by FerroFun View Post
    Thanks for asking. I have been thinking about that too. It will take some days of work to get the release build configured throughout the solution. I will work towards that and let you know. Of course, I will still need to get the debug builds working.

    FF
    As a test, pick just one project that gives the error in debug mode and try to compile it in release mode. Also, use the find in files search feature and search all files for 'mfc80d'. Perhaps they are referenced some place unexpectedly?

  8. #8
    Join Date
    Feb 2008
    Posts
    29

    Re: Migrating from VS2005 to VS2015 Still Tries to Link MFC 8

    Quote Originally Posted by Arjay View Post
    As a test, pick just one project that gives the error in debug mode and try to compile it in release mode. Also, use the find in files search feature and search all files for 'mfc80d'. Perhaps they are referenced some place unexpectedly?
    Yes, thanks. I have searched for 'mfc80d' both internally within VS2015 and externally with the Windows 7 search tool. It is not found explicitly. Unfortunately, the one project that won't link because mfc80d.lib is not found is the project that generates the program executable. It depends on all other projects. I can remove many of them from the dependency list for the release build, but I still need to go through the migration process for fifteen or twenty projects that are critical dependencies. The rest are independent agents in the form of DLLs and can be ignored. I am going to start work on this on Monday, after the new year.

    Have a Happy New Year and thanks for the consideration.

    FF

Tags for this Thread

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