Saturday, April 10, 2021

fatal error LNK1104: cannot open file 'mfc42d.lib'

when I compile DPHULL demo project (C:\Demo_MFC\DPHull_demo), I ran into a lot of errors. mainly caused by template non-conformance issue due to conversion of 2003 template style.

but after resolved these issues, I still ran into the following errors. the final answer is that one OGLToolsd.lib file was compiled in 2003, it used mfc42d.lib. so these errors are coming from this lib file. after I used new lib file to override the old version, the error is resolved.

1>LINK : fatal error LNK1104: cannot open file 'mfc42d.lib'

Error LNK1104 cannot open file 'mfc42d.lib' GLDouglas C:\Demo_MFC\DPHull_demo\GLDouglas\LINK 1

  1. error LNK1104: cannot open file 'mfc42d.lib'
  2. When I converted VC6 code to Visual Studio 2010 I got error message:

    error LNK1104: cannot open file 'mfc42d.lib' C:\Agent\AgentShared\LINK AgentShared
    How to fix this?.

    solutionAccording to your description, I think there may be some other library the project linked to have depent on mfc42.lib. You can try sending information about the process of the linking session to the Output window. You can do it by opening the project's Property Pages->Configuration Properties->Linker->General->Show Progress and selecting "Display all progress messages (/VERBOSE)" option.

    I suppose there is some parts in the project have not got converted to the new compiler. I suggest you open the project in VS2010, and attempt to convert it. Finally, remember to rebuild the project. According to your description, I think there may be some other library the project linked to have depent on mfc42.lib. You can try sending information about the process of the linking session to the Output window. You can do it by opening the project's Property Pages->Configuration Properties->Linker->General->Show Progress and selecting "Display all progress messages (/VERBOSE)" option.

    I suppose there is some parts in the project have not got converted to the new compiler. I suggest you open the project in VS2010, and attempt to convert it. Finally, remember to rebuild the project.

    I suggest you try create a new project from existing code. Open VC2010, click File->New->Project From Existing Code in main menu, and select the fils of the current projects.

    Or you can Create a new project, and copy the useful codes to the new one. Of course, you should make changes if necessary.

  3. Why VC2010 tries to link the MFC42 dll after I upgraded my VC6 project
  4. I upgraded my Win32 project from VC6 to VC2010, and fixed a lot of codes which only work on VC6, compiling is OK, but when the project began linking, it failed with the following message

    LINK : fatal error LNK1104: cannot open file 'mfc42ud.lib'
    I tried to find where the MFC42ud is referred, but I cannot, it drives me mad. Could anyone help me?

    A Solution OK, at last I resolved it. It is because there are some libs I need link, and there is some linkage information in these libs.

    The reason is the Microsoft VC specified preprocessor #pragma comment(lib, "some.lib")

    Actually it is really a bad solution, especially to link system provided libs, like mfc libs. Even you upgraded the project, it still wants to link the old mfc libs.

    The solution is to ignore the old mfc libs.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

No comments:

Post a Comment