Xcode 6.0.1版gmp.h头文件找不到,尽管gmp.h和gmpxx.h在local/include中
Xcode Version 6.0.1 gmp.h header file not found, even though gmp.h and gmpxx.h are in local/include
我正在尝试让GMP与Xcode一起工作。到目前为止,我已经解开了主目录中的文件,运行了所有必要的命令来配置、制作和安装
./configure --prefix=/usr/local --enable-cxx
make
make check
sudo make install
gmp.h和gmpxx.h都在/usr/local/include中,但是我在尝试包含这些文件时仍然会遇到错误。我认为我需要添加一个complexer标志,但对于这个版本的Xcode,我不知道如何做到这一点。如果不是这样的话,我需要做一些其他的事情,请提供建议,我将非常感谢
我的代码如下所示:
#include <iostream>
#include <gmp.h>
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!n";
return 0;
}
我可以用c++中的GMP进行编码吗?还是我需要c中的代码?如果能为您提供任何帮助,我们将不胜感激,提前感谢!
很抱歉,如果这看起来像是一个重复的问题,我确实看了其他问题,但我无法按照之前问题的答案进行操作。
更新
将libgmp.la和libgmpxx.la添加到Xcode中,还将/usr/local/include添加到头文件搜索中,但它仍然不起作用!我在我的项目中看到了库文件,如果我放"gmp.h"而不是它有效,但当我使用gmp时,它无法告诉我将其他gmp文件更改为"gmp.h",这似乎是不对的。
有什么想法吗?
this is the fix according to another SO question:
1) Open the left panel,
goto "ProjectName", Targets, Build phases, Link binary with libraries
and select your library.
2) Open the left panel,
goto "ProjectName", Project, Header Search Paths,
write the path where the headers of your library are
(the .h files, usually in /usr/local/include).
3) Open the left panel,
goto "ProjectName", Project, Library Search Paths,
write the path where your libraries are
(the .a or .dylib files, usually in /usr/local/lib)
相关文章:
- 使用 GMP 的 while 循环出现问题
- 有没有一个 c++ gmp 库函数与 python gmpy2 库 divm(..) 函数相同?
- 使用 MinGW 在 Windows 上安装 GMP 时出错
- 为什么gmp会在这里与"invalid next size"重新定位一起崩溃?
- MSYS2 MinGW64 在 Windows 上构建 GMP/MPFR 作为静态库,并将它们链接到使用 CL 编译的
- 尝试运行 gmp 时未找到 MPIR.dll
- GMP-将64位整数存储在mpz_t/mpz_class中,并返回64位整数
- 使用Rcpp返回GMP类
- C++ - 带有 % 运算符的 GMP 库错误
- 如何导入使用自制软件安装的 GMP?
- 为什么提升日志中断会提升 GMP 多精度?
- 使用 GMP/ARB 矩阵减少 OpenMP
- 使用GMP在C 中编译代码
- 如何使用 GMP 创建浮点数组?
- gmp 的 libgmp.so 有哪些依赖关系?我不断收到未定义的引用
- 如何使用整数初始化 GMP mpz_t
- 如何使用 std::cout 和 mini-gmp mpz-t.
- 在 macOS Mojave 上安装 sharpSAT - "'gmpxx.h' file not found"
- 使用GMP安装NTL
- Xcode 6.0.1版gmp.h头文件找不到,尽管gmp.h和gmpxx.h在local/include中