我在 C 项目中使用 min() 和 max() 函数时遇到问题。我已经导入了 math.h,但是当我编译文件时,我不断收到以下错误(即使使用 gcc 而不是 llvm,也会显示类似的错误):
Undefined symbols for architecture x86_64:
"_min", referenced from:
_main 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)
我认为问题在于没有 64 位的 math.h 库……或者编译器找不到它。我正在使用 Mac OS X 10.7。我该如何解决这个问题?