开发者

C: Undefined symbols for architecture x86_64 [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraord开发者_如何转开发inarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

I call the function phtread_kill(gpsNavigationThread, 0) and ge the following error

Undefined symbols for architecture x86_64:

"_phtread_kill", referenced from:
  _startgpswatchdog in ccXXNhjy.o
ld: symbol(s) not found for architecture x86_64

I #include <pthread.h> so am not sure what the issue is.

I link as follows

gcc gps_nav.c dijk.c serial.c parser.c nav_corelogic.c -I/usr/include/libxml2 -lxml2 -lm -lpthread -o logic

I also #include signal.h but am not sure if there is a library for linking with it.


It's

pthread_kill(gpsNavigationThread, 0)

not:

phtread_kill(gpsNavigationThread, 0)


Have you linked with the pthreads library: -lpthread


Did you compile with -lpthread ?


Try the -pthread option, which should set the appropriate options for both compilation and linking.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜