【问题标题】:code execution cannot proceed because cpprest_2_10.dll was not found代码执行无法继续,因为找不到 cpprest_2_10.dll
【发布时间】:2023-03-08 17:46:01
【问题描述】:

我的目标是在 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个这样的错误)

我用谷歌搜索它并被告知将相应的“.lib”文件包含到“属性->链接器->输入->附加依赖项”中,并将相应“.dll”文件的路径包含到“属性”中-> Linker->General->Additional Library Directories”,我做了什么。

现在,再次运行代码,出现如下错误:

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

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

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

【问题讨论】:

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


    【解决方案1】:

    尝试把丢失的dll文件放到你编译好的exe目录下。

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

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

    【讨论】:

    猜你喜欢
    • 2020-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-04
    • 2021-08-14
    • 2013-01-26
    相关资源
    最近更新 更多