c++ - gcc在其所在目录下找不到libcurl头文件
问题描述
我正在尝试使用以下命令编译 cpp:
g++ -IC:\Users\XXX\libcurl-7.56.0\libcurl-7.56.0\include\curl -LC:\Users\XXX\libcurl-7.56.0\libcurl-7.56.0\lib program.cpp
这个程序有一个使用 libcurl 的头文件。curl 库位于 -
C:\Users\XXX\libcurl-7.56.0\libcurl-7.56.0\include\curl\curl.h
即使 curl.h 在路径中,gcc 也会出现以下错误 -I
mylibrary.h:26:10: fatal error: curl/curl.h: No such file or directory
#include <curl/curl.h>
我究竟做错了什么?
解决方案
The error message means the file curl/curl.h
could not be found in the search path specified by -I. You updated the question with the path to the file so the command should be:
g++ -IC:\Users\XXX\libcurl-7.56.0\libcurl-7.56.0\include -LC:\Users\XXX\libcurl-7.56.0\libcurl-7.56.0\lib program.cpp
Also, can you please try using \ instead of / as path separator in your mylibrary.h file:
#include <curl\curl.h>
推荐阅读
- javascript - 需要在节点mongodb/mongoose中使用多个数据库
- r - 为从原始组合数据帧拆分的每个 csv 文件包含一个标准文件名前缀
- django - 为什么发送删除请求会触发 get_queryset() Django 方法?
- excel - Excel:如何使用 Xlookup 动态返回列
- git - 如何检测(并可能自动合并)从下游分支返回到上游的 git 提交
- node.js - 无法从 express 中读取 cookie
- excel - 当用户单击 Excel 中的特定按钮时,如何编写条件?
- python-3.x - 我在处理重复值的二进制搜索树类中的插入方法是否错误地将元素放入?(Python)
- extjs - 允许网格高度随行数变化(自动高度)
- javascript - 如何在 Jest 中模拟组件中的函数