Я пытался скомпилировать программу на C в Mac OS X, используя gcc.Однако я получил ошибку: clang: error: команда линкера завершилась неудачно с кодом выхода 1 (используйте -v, чтобы увидеть вызов).
Хотя я читал некоторые похожие вопросы по этому поводу, я все еще не могу найтирешение.Любая помощь будет оценена.
ncl-kaist:intro vietan$ make -n
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcli daytimetcpcli.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpcli1.o daytimetcpcli1.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcli1 daytimetcpcli1.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpcli2.o daytimetcpcli2.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcli2 daytimetcpcli2.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpcli3.o daytimetcpcli3.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcli3 daytimetcpcli3.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpsrv.o daytimetcpsrv.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpsrv daytimetcpsrv.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpsrv1.o daytimetcpsrv1.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpsrv1 daytimetcpsrv1.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpsrv2.o daytimetcpsrv2.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpsrv2 daytimetcpsrv2.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpsrv3.o daytimetcpsrv3.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpsrv3 daytimetcpsrv3.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpcliv6.o daytimetcpcliv6.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcliv6 daytimetcpcliv6.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o daytimetcpsrvv6.o daytimetcpsrvv6.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpsrvv6 daytimetcpsrvv6.o ../libunp.a -lresolv -lpthread
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o byteorder.o byteorder.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o byteorder byteorder.o ../libunp.a -lresolv -lpthread
ncl-kaist:intro vietan$ make
gcc -I../lib -g -O2 -D_REENTRANT -Wall -o daytimetcpcli daytimetcpcli.o ../libunp.a -lresolv -lpthread
ld: warning: ignoring file ../libunp.a, file was built for archive which is not the architecture being linked (x86_64): ../libunp.a
Undefined symbols for architecture x86_64:
"_err_quit", referenced from:
_main in daytimetcpcli.o
"_err_sys", referenced from:
_main in daytimetcpcli.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: *** [daytimetcpcli] Error 1