Back To Overview
How To Use the baselib.a?
Posted on 13 Feb, 2012 by LiuJingrui
Hi,I am a new user to the gpstk.When I began to learn about the double difference observation, I found the baselib.a in the folder "gpstk/apps/geomatics/relposition".But after the building of the gpstk, I cannot use the baselib.a. When I had a project with QT, I Can find all the gpstk lib except the baselib.a. Could you give me some suggestions on how to build or use the baselib.a? Thank you very much.

Add your comments to the Discussion

Liu Jingrui,

If you find that the pthread library is available and reachable, try adding your -lpthread reference to the end of your compile command along with the other libraries' references -- that could make the difference.

Best Regards,

-- Susan Cummins
SusanCummins 01 Mar 2012 - 15:13

Liu Jingrui,

It appears that you are missing the pthread library, or that it is somehow inaccessible (access permission may not be granted). I suggest determining whether your system libraries include the pthread library, and whether you have access permission from your gpstk build directory. Please let me know if this helps. Good luck!

Best Regards,

-- Susan Cummins
SusanCummins 01 Mar 2012 - 09:51


First,thanks for your help about the last baselib.a and Now I came across a new problem. When I compiled the gpstk in the ubuntu 11.10 with the gcc4.6.1 and g++4.6.1, it cames:

Link apps/swrx/trackerMT
apps/swrx/trackerMT.o: In function `RxSim::process()':
trackerMT.cpp:(.text+0x41b6): undefined reference to `pthread_create'
trackerMT.cpp:(.text+0x4225): undefined reference to `pthread_join'
collect2: ld 返回 1

cc -lpthread -o apps/swrx/trackerMT apps/swrx/trackerMT.o apps/swrx/simlib.a src/libgpstk.a -lm -lstdc++

...failed Link apps/swrx/trackerMT ...
Link apps/swrx/RX
apps/swrx/RX.o: In function `RxSim::process()':
RX.cpp:(.text+0x430d): undefined reference to `pthread_create'
RX.cpp:(.text+0x4375): undefined reference to `pthread_join'
collect2: ld 返回 1

cc -lpthread -o apps/swrx/RX apps/swrx/RX.o apps/swrx/simlib.a src/libgpstk.a -lm -lstdc++

...failed Link apps/swrx/RX ...

I tried to find the solution on the internet about the "undefined reference to `pthread_create'", but there was only a advice adding the compiling parameter "-lpthread".
But it had this parameter. Could you give me some suggestions? Thank you all the same.

Jingrui Liu
LiuJingrui 28 Feb 2012 - 18:56

Liu Jingrui,

Although the Qt environment is not explicitly supported for the GPSTk, there is information available on how to link dynamic or static libraries within Qt. You will need to determine whether you want baselib to be accessible as a dynamic library (accessed at runtime) or static library (accessed at build time). You may need administrator privilege to install baselib as a system library.

This link may be helpful:

Hope this helps.

Best Regards,

-- Susan Cummins
SusanCummins 22 Feb 2012 - 15:04

According to your advice, I have built the baselib.a and DDBase successfully. And there exists the baselib.a in the filrpath "/apps/geomatics/relposition/". But there are a problem that when I try to use the baselib.a in a compiler such as Qt, I cannot add the baselib.a into the project. I want to know whether the baselib.a is a systemlib.a or not and how I can use the baselib.a to process some data. Could you geive me some examples ? Many Thanks!
--Liu Jingrui
LiuJingrui 18 Feb 2012 - 03:05

Liu Jingrui,

The baselib.a library is built by the Jamfile in the directory you mention, /apps/geomatics/relposition/. The DDBase applicaton is also built from that Jamfile. Assuming you have downloaded or checked out the source code, try rebuilding using the Jamfile by running these two commands from within /apps/geomatics/relposition:

> jam clean
> jam

Good luck, and please let me know if you're able to successfully build baselib.a and DDBase. Also, if you still encounter problems, please let me know what operating system you're running on, how you downloaded or checked out the gpstk code, and any error messages that occurred while the gpstk was being built (assuming you're building from source code).

Best Regards,

-- Susan Cummins
SusanCummins 17 Feb 2012 - 10:57

Topic revision: r7 - 01 Mar 2012, SusanCummins

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback