即使包含库,也不能将 curlpp 与 Xcode 一起使用

Can't use curlpp with Xcode even though library is included

我试图在我的 Xcode c++ 项目中使用 curlpp,但即使我在项目设置中将库添加到目标,我被告知 "file not found" 行

#include <curlpp/cURLpp.hpp>

我可能做错了什么,但我不确定是什么。我关注了some instuctions together with another Whosebug question(没多久)。以下是我的具体步骤:

  1. 我从 Google Code
  2. 下载了源代码
  3. 我解压了等等,然后我运行./configure --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info --without-boost
  4. 我在 Makefile 中更改了一行:SUBDIRS = src include examples docSUBDIRS = src include doc(删除了 "examples")
  5. 我运行make
  6. 我运行sudo make install

一切运行没有问题。所以我想包括图书馆:

  1. 目标 -> 构建阶段 -> Link 带库的二进制文件 -> “+” -> 添加其他
  2. 如果我没理解错的话,库一定在/usr/local
  3. 我在 /usr/local/lib
  4. 中找到 libcurlpp.0.dylib
  5. 是隐藏文件夹,所以我把它复制到项目目录下,添加到项目中
  6. 我点击了编译。
  7. Xcode告诉我'curlpp/cURLpp.hpp' file not found

非常感谢任何帮助!我仍在从 ruby/javascript/python 切换到 C++! :)

看起来您的链接正常,但如果 Xcode 找不到 header,则表示您没有正确设置 header 搜索路径。 转到构建设置 --> Header 搜索路径并将路径添加到您的 header。由于您包含 'curlpp/cURLpp.hpp',您的路径必须是包含文件夹 'curlpp'.

的文件夹