【发布时间】:2014-03-21 14:09:32
【问题描述】:
我一直在尝试在程序中使用包含的 libevent,但一直收到错误消息。
gcc lumberd.c Network.c ../Config.c -o lumberd.x
Undefined symbols for architecture x86_64:
"_event_base_new", referenced from:
_main in lumberd-c86954.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我认为它可能无法链接,所以我添加了 -L 选项,这给了我同样的错误。我知道我的 /usr/local/include 目录中安装了 libevent。
【问题讨论】: