当我尝试使用 xcode 编译和运行此处找到的 gmp-chudnovsky.c 文件时,出现以下错误:
Undefined symbols for architecture x86_64:
"_fac_clear", referenced from:
_main in main.o
"_fac_compact", referenced from:
_fac_remove_gcd in main.o
"_fac_init", referenced from:
_main in main.o
"_fac_mul", referenced from:
_bs in main.o
"_fac_mul_bp", referenced from:
_bs in main.o
"_fac_resize", referenced from:
_fac_remove_gcd in main.o
"_fac_set_bp", referenced from:
_bs in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我知道gmp 库安装正确,因为我有另一个链接到它的 xcode 项目正在正确编译。关于为什么会发生这种情况的任何想法?
忘了说我已经为 GMP 添加了头文件和库的路径,并在 Other Linker Flags 下添加了 -lgmp 标志