1

I am trying to compile my code including pocketsphinx which needs a dll file to compile. I have tried using both a .dll and .lib file but I get this error.

Error   LNK1107 invalid or corrupt file: cannot read at 0x300
  • Possible duplicate of [Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?](https://stackoverflow.com/questions/133698/why-does-fatal-error-lnk1104-cannot-open-file-c-program-obj-occur-when-i-c) – Andre Kampling Aug 24 '17 at 13:58
  • That didn't help. I now get this error: Error LNK1107 invalid or corrupt file: cannot read at 0x300 –  Aug 24 '17 at 14:19
  • 1
    Possible duplicate of [Lib and DLL linking to an exe confusion](https://stackoverflow.com/questions/8599539/lib-and-dll-linking-to-an-exe-confusion) – Nikolay Shmyrev Aug 24 '17 at 16:51
  • 1
    Agreed. Until you posted that I did not notice the OP was trying to link to the `dll` instead of the `lib`. – drescherjm Aug 24 '17 at 17:23
  • You should not get this same error if you link to the `.lib` and remove any link to the `.dll`. Since this is an x64 binary make sure you are creating a 64 bit application. – drescherjm Aug 24 '17 at 17:39
  • When I use the lib files I get: Error LNK2019 unresolved external symbol _cmd_ln_init referenced in function _main Error LNK2019 unresolved external symbol _ps_args referenced in function _main –  Aug 25 '17 at 13:59

0 Answers0