Hi, I should first say that am a newbie with C++ and am running GPSTK under the cygwin environment. I was able to compile and run examples one to four. But when I try to compile example5.cpp I get the following error (only showing first four lines):

example5.cpp:50:25: error: ModeledPR.hpp: No such file or directory example5.cpp:60:25: error: SolverWMS.hpp: No such file or directory example5.cpp:104: error: 'ModeledPR' does not name a type example5.cpp:110: error: 'SolverWMS' does not name a type ... ... ...

I assume that this means that the compiler is not finding ModeledPR.hpp and SolverWMS.hpp. These files are located in my directory: ~\home\user\gpstk\lib\procframe

I tried several different combinations to run the compiler. This is the one that was working with the other four examples:

g++ -o example -I ~/gpstk/lib/ -L ~/gpstk/src/ example5.cpp -lgpstk

So I guess, atleast to me, it seems like i need to add the sub-directories? or is this done automatically? Sorry for the simpleton question. But any help would be appriciated big grin


-- NodaHart - 17 Jun 2011


ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Dear Noda,

There is a Jamfile in the /examples directory that can be used to build all of the examples (I'm assuming you've downloaded the source code package for release 1.7). When built, they're accessible from within the /examples directory. I recommend this approach to building the examples, but it may also be the case that if you move the source file name in your compile command to be in front of all of your include and library references, you may be able to compile that way. Take a look at the Jamfile, though, even if you want to stick with separately compiling each example, because it will show you what external references may be needed for specific examples. Good luck, and let me know if this helps!

Best Regards,

-- Susan Cummins

-- SusanCummins - 20 Jun 2011

Thanks Susan, I tried to build the examples using the jamfile but when I ran it I got the following:

$ jam ...found 329 target(s)... ...updating 27 target(s)... Link example1 cc: ../lib/procframe/libprocframe.a: No such file or directory cc: ../src/libgpstk.a: No such file or directory

cc -o example1 example1.o ../lib/procframe/libprocframe.a ../src/libgpstk.a -l m

...failed Link example1 ... Link example2 cc: ../lib/procframe/libprocframe.a: No such file or directory cc: ../src/libgpstk.a: No such file or directory

cc -o example2 example2.o ../lib/procframe/libprocframe.a ../src/libgpstk.a -l

-- NodaHart - 27 Jun 2011

Hi Noda,

It looks like jam can't find the libraries that it needs to link the examples. Be sure to build the gpstk library first (libgpstk.a), then any other libraries that are needed. Most examples require the gpstk and procframe libraries, which means these two libraries have to be built before attempting to build these examples so they can link properly. You can tell which examples require which libraries by looking at the Jamfile in the /examples directory. The Jamfile to build libgpstk.a is in /src. The Jamfile to build all the rest of the libraries is in the /lib directory. If you want to build a single library, there is a Jamfile in each library's main directory. Directory /lib/geomatics, for example, has the Jamfile to build libgeomatics.a.

Hope this helps, let me know if you have any more questions, and if so, please let me know exactly form/version of the GPSTk that you downloaded or checked out, so I'll know if I'm approaching this from the right perspective.

Good luck, please let me know if you have success!

Best Regards,

-- Susan Cummins

-- SusanCummins - 28 Jun 2011

Thanks again Susan. There still appears to be some problems so I will start from the beginning. I am running cygwin on windows 7 (32 bit). Therefore I followed the instructions at <>

Here are the steps I followed: I downloaded cygwin and installed gcc. The version is: gcc version 4.3.4 20090804 (release) 1 (GCC)

I downloaded Jam and have added it to the system path. The version is: $ jam -v Jam 2.5. OS=UNKNOWN. Copyright 1993-2002 Christopher Seiwald.

I then downloaded the source files for the gpstk from:

I downloaded the GPSTK source files from source forge: gpstk-1.7.src.tar.gz

I extracted the source files to "/home/user/" using the command: tar xvzf gpstk-1.7.src.tar.gz

Next I cd'd to the /home/user/gpstk/ and then typed jam at the command prompt. This should build all of the libraries that you mentioned correct?

The process runs fine for a while, but eventually I get some warnings and errors. Here are a few examples:

src/getopt.c:661: warning: incompatible implicit declaration of built-in function 'strlen'

src/Antenna-l.o:Antenna.cpp:(.text$_ZNSt8_Rb_treeIN5gpstk7Antenna13frequencyType ESt4pairIKS2_St6vectorIdSaIdEEESt10_Select1stIS8_ESt4lessIS2_ESaIS8_EE7_M_copyEP KSt13_Rb_tree_nodeIS8_EPSG_[std::_Rb_tree<gpstk::Antenna::frequencyType, std::pa ir<gpstk::Antenna::frequencyType const, std::vector<double, std::allocator > >, std::_Select1st<std::pair<gpstk::Antenna::frequencyType const, std::vect or<double, std::allocator > > >, std::less<gpstk::Antenna::frequencyType >, std::allocator<std::pair<gpstk::Antenna::frequencyType const, std::vector<dou
ble, std::allocator > > > >::_M_copy(std::_Rb_tree_node<std::pair<gpstk: :Antenna::frequencyType const, std::vector<double, std::allocator > > > const*, std::_Rb_tree_node<std::pair<gpstk::Antenna::frequencyType const, std::v ector<double, std::allocator > > >*)]+0xc0): undefined reference to `___ cxa_rethrow'

lib/vplot/SurfacePlot-l.o:SurfacePlot.cpp:(.text$_ZN5vplot4PlotD2Ev[vplot::Plot: :~Plot()]+0x14c): more undefined references to `std::basic_string<char, std::cha r_traits, std::allocator >::_Rep::_M_destroy(std::allocator co nst&)' follow lib/vplot/SurfacePlot-l.o:SurfacePlot.cpp:(.eh_frame+0x12): undefined reference to `___gxx_personality_v0' collect2: ld returned 1 exit status

cc -shared -O -Wl, -o lib/vplot/ lib/vplo t/Axis-l.o lib/vplot/LinePlot-l.o lib/vplot/Plot-l.o lib/vplot/ScatterPlot-l.o l ib/vplot/SeriesList-l.o lib/vplot/Splitter-l.o lib/vplot/SurfacePlot-l.o -lm

...failed Link lib/vplot/ ...

-- NodaHart - 29 Jun 2011

Hi Susan,

I just finished building on a linux machine and have not had any problem and the examples are working fine. The instructions worked very straight forward. Anyhow, ideally I would like to run through cygwin but we will see....


-- NodaHart - 30 Jun 2011

Hi again Noda,

I'm glad you've had success on linux -- I usually find linux to be the easiest OS to build on. But to get back to cygwin issues, I have a suggestion (or two). I have sometimes had difficulty building when the jam utility I've used is not fully compatible with cygwin. There is a link to download a compatible version at the bottom of the Downloads page on the gpstk site:

Another suggestion is to download the pre-built version of the toolkit for cygwin, which contains the already-built dynamic libraries that you can link to. It appears that the GPSTk libraries aren't building correctly for you under cygwin, and the error messages seem to indicate a problem finding certain external references in the standard c++ library, so you may want to make sure that you are indeed invoking the c++ compiler/linker, and that the standard c++ libraries are present. Hope this helps, and good luck!

Best Regards,

-- Susan Cummins

-- SusanCummins - 30 Jun 2011 No such template def TMPL:DEF{PROMPT:supportquery}

Topic revision: r8 - 12 Jun 2015, UnknownUser

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