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.
精彩评论