GPSTK undefined reference to ' pthread_create ' undefined reference to ' pthread_create ', TRACKERMT.O

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.