none
LNK1107: invalid or corrupt file: cannot read at 0x300

    Question

  • Hi,

    I'm using VC++ 2005 to build a dll. This dll I have tested using a Win32 console project, it  worked fine. When I use this DLL in WTL project, I have a link error as following:

    LNK1107: invalid or corrupt file: cannot read at 0x300.

    Can anyone help me to over come this problem?

    Thanks

    Aaron
    Thursday, March 09, 2006 7:24 AM

Answers

  • How you are including a DLL into a project?

    You need to add the lib file to the libnker options not the DLL!

    Thursday, March 09, 2006 7:41 AM
    Moderator

All replies

  • How you are including a DLL into a project?

    You need to add the lib file to the libnker options not the DLL!

    Thursday, March 09, 2006 7:41 AM
    Moderator
  • My mistake to put the dll instead of lib.

    Thank you very much, Martin.
    Thursday, March 09, 2006 7:46 AM
  • Why need to link .lib file instead of dll because i using some opencv library where it has some dll and i thought that i need to link with dll but once i link with dll and appear the same error. After that i try link lib, it works.

    Why ?

    Thanks.

    C++
    Tuesday, September 08, 2009 6:20 AM
  • If you are used to linux or possibly new to DLL files it may seem strange that you need to link to a file which isn't the DLL.
    When using a DLL the thing you must remember is that they come in pairs, one DLL to contain the code and an import library to access the DLL.

    Read the MSDN for more information.

    http://msdn.microsoft.com/en-us/library/ms682589(VS.85).aspx


    Visit my (not very good) blog at http://c2kblog.blogspot.com/
    Tuesday, September 08, 2009 9:44 AM
  • If you are used to linux or possibly new to DLL files it may seem strange that you need to link to a file which isn't the DLL.
    When using a DLL the thing you must remember is that they come in pairs, one DLL to contain the code and an import library to access the DLL.

    Yes, i new to dll. OK. I remember that dll come in pair where the .lib(import library to access the DLL) and the real dll contain the code implementation.

     

    Thanks.

     



    C++
    Wednesday, September 09, 2009 7:21 AM