当我尝试使用xcode编译并运行gmp-chudnovsky.c文件here时,会出现以下错误:
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 library已正确安装,因为我有另一个正在编译的xcode项目链接到它。关于为什么会发生这种情况的任何想法?
忘了说我已经为GMP添加了头文件和库的路径,并在其他链接器标志下添加了-lgmp标志