我正在使用wsl-2运行windows 10,使用远程wsl,我正在尝试使用vcpkg附加一个外部库,我安装了一个trail pacakge,但Curl没有工作。
#include <iostream>
#include <curl/curl.h>
using namespace std;
int main()
{
cout<<"hello";
}这给了我错误
1. #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/mnt/d/projectsc++/scrap/main.cpp).
2. cannot open source file "curl/curl.h"
3. curl/curl.h: No such file or directory但当我试着跑
./vcpkg install curl它向我展示了curl已经安装和配置了。
Computing installation plan...
The following packages are already installed:
curl[core,non-http,openssl,ssl]:x64-linux
Package curl:x64-linux is already installed
Total elapsed time: 36.7 us
The package curl:x64-linux provides CMake targets:
find_package(CURL CONFIG REQUIRED)
target_link_libraries(main PRIVATE CURL::libcurl)我对这件事很陌生,所以我不太明白,但是有人能解释我做了什么错误吗?
发布于 2020-06-16 21:48:52
find_package通常应该找到包含dir的内容。但是,在您的find_package命令之后添加以下内容是否有效。
include_directories(${CURL_INCLUDE_DIRS})
https://stackoverflow.com/questions/62266265
复制相似问题