Mac编译 symbol(s) not found for architecture x86_64 ?修改
uname
Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
gcc -lncurses -o "veto_mq_server" ./src/veto_mq_server.o
Undefined symbols for architecture x86_64:
"_zmq_bind", referenced from:
_main in veto_mq_server.o
"_zmq_ctx_new", referenced from:
_main in veto_mq_server.o
"_zmq_recv", referenced from:
_main in veto_mq_server.o
"_zmq_send", referenced from:
_main in veto_mq_server.o
"_zmq_socket", referenced from:
_main in veto_mq_server.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
引用了第三方库ZMQ
/usr/local/include/
-rw-r--r--@ 1 root admin 844 Mar 10 15:00 zmq_utils.h
-rw-r--r--@ 1 root admin 16613 Mar 10 15:00 zmq.h
/usr/local/lib/
lrwxr-xr-x 1 yanrui admin 43 Mar 18 2015 libzmq.4.dylib -> ../Cellar/zeromq/4.0.5_2/lib/libzmq.4.dylib
-rwxr-xr-x 1 root admin 958 Mar 10 15:00 libzmq.la
lrwxr-xr-x 1 root admin 14 Mar 10 15:00 libzmq.dylib -> libzmq.5.dylib
-rw-r--r-- 1 root admin 23545352 Mar 10 15:00 libzmq.a
-rwxr-xr-x 1 root admin 602308 Mar 10 15:00 libzmq.5.dylib