Setting Library path for win32 console applications

后端 未结 4 1783
梦如初夏
梦如初夏 2021-01-03 10:55

I am getting \"dll not found:restarting the application may fix the problem\" error when i try to execute a simple \"HelloWorld\" win32 console application. I know the locat

4条回答
  •  -上瘾入骨i
    2021-01-03 11:42

    DLL loading happens deep in the plumbing of windows.

    If the DLL is not found in the same directory as the application, the PATH is automatically scanned in order to find the directory.

    So, the simplest answer to your problem is to add the directory containing the DLL to your PATH. Depending on when the DLL needs to be loaded by your code, you may be able to (temporarily) modify the PATH from inside your "HelloWorld" application.

提交回复
热议问题