Mac OS X没有找到另一个符号问题。我编写了一个使用libev事件循环库的C程序,在编译时会生成此输出:
$ make
clang midnight.c midnight_logging.c -o midnight
Undefined symbols for architecture x86_64:
"_ev_default_loop", referenced from:
_main in midnight-Wlcawk.o
"_ev_io_start", referenced from:
_main in midnight-Wlcawk.o
"_ev_run", referenced from:
_main in midnight-Wlcawk.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [midnight] Error 1
我用homebrew安装libev。共享库每个正常位于/ usr / local / lib中,我使用了编译器参数的每个组合,包括“-I / usr / local / lib”,“ - l libev”和“-L / usr / local / lib” ”
协助表示赞赏,我宁愿不必静态编译。
答案 0 :(得分:3)
但你 没有 链接来攻击自由!编译器不是透视者(也不是链接器),你必须告诉它搜索这些符号的内容......
clang midnight.c midnight_logging.c -o midnight -lev