There is already a dll file, and an error is reported: "The code cannot be executed if XXXXX.dll is missing. Reinstalling the program may solve this problem"

solution

I have tried many methods of the blog, and it is recommended to copy the dll directly to the project directory, which is particularly cumbersome and will result in a large project folder.
Get inspiration from this article: Link
Project->Properties->Environment
Enter path=(no spaces) (the directory where you store the dll)
Note: Do not have spaces,
for example mine: path=D:\test\libtorch\lib
if you want Add multiple paths, separated by semicolons. Such as: path=D:\test\libtorch\lib;D:\test\OpenCV\build\x64\vc15\bin;
Demo

Guess you like

Origin blog.csdn.net/qq_40841018/article/details/109646747