【发布时间】:2014-08-05 15:43:32
【问题描述】:
下面是使用 curl 的简单 test.c 代码:
#include <stdio.h>
#include <curl/curl.h>
int main(){
return 0;
}
为了编译这段代码,我使用:
gcc test1.c -lcurl -o test1
对于 test1.c 上面的编译是正确的。现在我想使用 C++ 库 (curlpp) 编写一些代码,然后编译它。
#include <iostream>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
int main(){
return 0;
}
我尝试编译这段代码:
g++ test2.cpp -lcurl -o test2
但我收到此错误:
fatal error: curlpp/cURLpp.hpp no such file or directory
compilation terminated.
这个公式不正确。问题是如何编译第二个代码——test2.cpp?
【问题讨论】:
-
你能edit你的问题更详细地描述“它不起作用”吗?
-
简单:如何编译第二个代码test2.cpp?
-
您是否收到某种消息告诉您它不正确?
-
"致命错误:curlpp/cURLpp.hpp 没有这样的文件或目录编译终止。"
标签: c++ linux curl compilation