Question

After building GPStk using jam, we tried to test one of the examples using the command: [root@localhost examples]$g++ -o example -I/usr/local/gpstk/dev/src -L/usr/local/gpstk/dev/src -lgpstk example1.cpp

we have the following error in output:

tmp/ccI4JGtp.o(.text+0x19): In function `main':

: undefined reference to `gpstk::DayTime::DayTime[in-charge]()'

/tmp/ccI4JGtp.o(.text+0x48): In function `main':

: undefined reference to `gpstk::DayTime::GPSfullweek() const'

/tmp/ccI4JGtp.o(.text+0x164): In function `main':

: undefined reference to `gpstk::Exception::Exception[in-charge](gpstk::Exception const&)'

/tmp/ccI4JGtp.o(.text+0x177): In function `main':

: undefined reference to `gpstk::operator<<(std::basic_ostream<char, std::char_traits >&, gpstk::Exception const&)'

/tmp/ccI4JGtp.o(.gnu.linkonce.t._ZNK5gpstk7DayTime9GPSsecondEv+0xd): In function `gpstk::DayTime::GPSsecond() const':

: undefined reference to `gpstk::DayTime::GPSsow() const'

/tmp/ccI4JGtp.o(.gnu.linkonce.t._ZNK5gpstk7DayTime6GPSdayEv+0xd): In function `gpstk::DayTime::GPSday() const':

: undefined reference to `gpstk::DayTime::dayOfWeek() const'

collect2: ld returned 1 exit status

Could you tell us what is wrong and how to solve it?

Regards,

-- RobertoCapua - 30 Jan 2009

Answer

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 Roberto:

It may be that you had a error when compiling the library. Are you sure it compiled without errors, and that it was later properly installed in your system?.

Best regards,

Dago

-- DagobertoSalazar - 04 Feb 2009

-- DagobertoSalazar - 04 Mar 2009

I have the same problem? who can help me. Thanks a lot! I use cygwin

-- ZhoufengRen - 30 Mar 2011

And I installed it without any errors expcet:build/install of mdpscreenx is being skipped; see jamfile

-- ZhoufengRen - 31 Mar 2011

Dear ZhoufengRen,

You may wish to try using the Jamfile in the /examples directory to build all the examples. If that fails, please let me know what error messages you see, and we'll go from there. Good luck!

-- SusanCummins - 31 Mar 2011

Dear SusanCummins It works. Than you very much! But i don't know why it can't work with the command: "g++ -o example -I/usr/local/gpstk/dev/src -L/usr/local/gpstk/dev/src -lgpstk example1.cpp". I think it include the header files and the lib files. It shold work.But it dosen't . i am a freshman in c++. smile

-- ZhoufengRen - 12 Apr 2011

Dear ZhoufengRen,

Your command should work if you move the "-lgpstk" library reference to follow the source file name "example1.cpp". Please try that and let me know if that works for you.

-- SusanCummins - 12 Apr 2011

Dear SusanCummins It works very well. After I put the source file "example1.cpp" in front of the reference files" -I/usr/local/gpstk/dev/src -L/usr/local/gpstk/dev/src -lgpstk ". Thans a lot for your help! Best wishes!

-- ZhoufengRen - 13 Apr 2011 No such template def TMPL:DEF{PROMPT:supportquery}

Topic revision: r9 - 13 Apr 2011, ZhoufengRen
 

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