首页
学习
活动
专区
圈层
工具
发布

vcpkg卷曲
EN

Stack Overflow用户
提问于 2020-06-08 16:00:55
回答 1查看 1.9K关注 0票数 1

我正在使用wsl-2运行windows 10,使用远程wsl,我正在尝试使用vcpkg附加一个外部库,我安装了一个trail pacakge,但Curl没有工作。

代码语言:javascript
复制
#include <iostream>
#include <curl/curl.h>

using namespace std;

int main()
{
   cout<<"hello";
}

这给了我错误

代码语言:javascript
复制
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

但当我试着跑

代码语言:javascript
复制
./vcpkg install curl

它向我展示了curl已经安装和配置了。

代码语言:javascript
复制
 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)

我对这件事很陌生,所以我不太明白,但是有人能解释我做了什么错误吗?

EN

回答 1

Stack Overflow用户

发布于 2020-06-16 21:48:52

find_package通常应该找到包含dir的内容。但是,在您的find_package命令之后添加以下内容是否有效。

include_directories(${CURL_INCLUDE_DIRS})

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62266265

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档