代码执行无法进行,因为未找到cpprest_2_10.dll

时间:2018-07-24 14:44:41

标签: c++ dll visual-studio-2017 unresolved-external lib

我的目的是在Visual Studio中使用Rest API。 我从https://github.com/Microsoft/vcpkg下载了C ++工具vcpkg,并按照https://github.com/Microsoft/cpprestsdk上的说明安装了cpprestsdk。很好。

然后,在Visual Studio中解决方案资源管理器的属性中,我包括了从vcpkg文件夹到“ VCC ++目录->包含目录”的以下路径:

  

vcpkg-master \ vcpkg-master \ buildtrees \ cpprestsdk \ src \ v2.10.2-718a4e55e9 \ Release \ include \ cpprest

     

vcpkg-master \ vcpkg-master \ buildtrees \ cpprestsdk \ src \ v2.10.2-718a4e55e9 \ Release \ include

     

vcpkg-master \ vcpkg-master \ buildtrees \ cpprestsdk \ src \ v2.10.2-718a4e55e9 \ Release \ include \ pplx

然后我运行我的代码,发生以下错误:

LNK2001 unresolved external symbols(类似32个错误)

我用Google搜索它,并被告知将相应的“ .lib”文件包含在“属性->链接器->输入->其他依赖项”中,并将相应的“ .dll”文件的路径包含在“属性”中->链接器->常规->其他图书馆目录”,我所做的。

现在,再次运行代码,只会发生以下错误:

code execution cannot proceed because cpprest_2_10.dll was not found. Reinstalling the program may fix the problem

尽管路径“ cpprest_2_10.dll”在我之前包含的路径中。

我不知道问题是什么。预先感谢您的宝贵时间。

1 个答案:

答案 0 :(得分:1)

尝试将丢失的dll文件放到已编译exe的目录中。

或检查此答案以设置路径,以便您的二进制文件可以找到dll文件:

How do I set the path to a DLL file in Visual Studio?