LNK1318: Unexpected PDB error; OK (0)

后端 未结 9 1803
借酒劲吻你
借酒劲吻你 2021-02-12 14:30

I\'m trying to link against a library (libcef_wrapper_dll.lib) that was built with the /MDd flag. My application is build with /MDd and /CLR so should be compatible. The proje

相关标签:
9条回答
  • 2021-02-12 15:07

    This one worked for me: Project properties -> C/C++ -> Code Generation -> Enable Function Level Linking -> Yes

    0 讨论(0)
  • 2021-02-12 15:12

    I had the problem because I had a file with the /clr option that was messing things up. I moved the CLR specific code to a separate file, cleaned, rebuilt and the problem is gone.

    0 讨论(0)
  • 2021-02-12 15:14

    If using /MP or /MDd with MSBuild, also use the /Zf compiler option. (See https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1318 )

    Other troubleshooting steps for LNK1318:

    • Do a full Clean/Rebuild
    • Restart mspdbsrv.exe
    • Turn off antivirus checks in your project directories.
    • Change the Debug Information Format to /C7 or None
    • Try building with /property:_IsNativeEnvironment=true
    0 讨论(0)
  • 2021-02-12 15:21

    Best solution for me has always been to simply kill the symbol server. I have a batch file on my desktop to do this:

    @for /F "tokens=2 delims= " %%I in ('tasklist^|findstr /I "mspdbsrv.exe"') do taskkill /F /PID %%I>NUL && echo Process killed.
    
    0 讨论(0)
  • 2021-02-12 15:23

    This is a technical limitation of the VC linker. You should try split your code modules up more. Splitting up libraries also help with extremely long link times.

    See if you can successfully build on release mode

    0 讨论(0)
  • 2021-02-12 15:24

    Rebuilding the project solved the problem

    0 讨论(0)
提交回复
热议问题