Undefined reference to ' pthread_create '
1. GPSTK Jam compile will appear trackermt and RX cannot connect to the library file Pthread, as follows
Cc-lpthread-o apps/swrx/trackermt APPS/SWRX/TRACKERMT.O APPS/SWRX/SIMLIB.A src/libgpstk.a-lm-lstdc++
Apps/swrx/trackermt.o:in function ' Rxsim::p rocess () ':
TrackerMT.cpp: (. text+0x3b4f): Undefined reference to ' pthread_create '
TrackerMT.cpp: (. Text+0x3bba): Undefined reference to ' Pthread_join ' 2. Solution Solutions
A. Find jamfile under apps/swrx/and replace the-lpthread inside-pthread
The reason is that-pthread will add the-pthread flag in the two stages of compiling and connecting, but the-pthread only adds flags during the connection phase. -pthread will perform different operations on different platforms, but it will be pthreads work. Sometimes omitting-pthread may roughly pthreads not work (normal).
B. Increase-pthread to linklibs substitution in linkflags increase-pthread
Because the linkflags incorrectly added-pthread causes-pthread to be included too early in the final command line,-pthread will be in *. 0 file before using this library file.
Some information about Jamfile will be introduced in the next blog post