Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#308 Linker error when compiling

closed-fixed
5
2012-10-03
2012-09-19
Fred
No

I get the following error when compiling on Slackware-13.37 cmake version 2.8.9, qt4 version 4.7.0

[ 30%] Building CXX object src/piklab-hex/CMakeFiles/piklab-hex.dir/main.o
Linking CXX executable piklab-hex
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tgetstr'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `BC'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `UP'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libreadline.so: undefined reference to `PC'
collect2: ld returned 1 exit status
make[2]: *** [src/piklab-hex/piklab-hex] Error 1
make[1]: *** [src/piklab-hex/CMakeFiles/piklab-hex.dir/all] Error 2
make: *** [all] Error 2

Cheers,

Fred

Discussion

  • Hi Fred,

    could you try the latest sources and tell me if it sill fails to link?

    Thanks,
    Nicolas

     
    • labels: --> Installation/compilation
    • assigned_to: nobody --> azhyd
     
  • Fred
    Fred
    2012-10-01

    Nicolas,

    I tried a fresh pull from svn. It still gives the same exceptions about undefined references. I looked at how readline builds on Slackware and noticed that it is linked with libcurses.so and libtermcap.so. If I try to link piklab-hex to either of these libraries instead of libreadline.so then the 'tgetstr',etc. errors disappear but readline c and c++ function errors appear. This is about the extent of my abilities with this but I will try to help as much as I can. Don't know c or c++ really at all but have had some experience building packages from source and running make, cmake, etc.

    Cheers,

    Fred

     
  • Hi Fred,

    my change was incomplete. Could you try again? If it fails, could you post the errors you get?

    Thanks,
    Nicolas

     
  • Fred
    Fred
    2012-10-02

    Nicolas,

    It seems to be building fine now on two separate machines. My server and netbook. Both are running Slackware. I will post again if I have any other issues.

    Thank you very much for your help and for piklab!

    Cheers,

    Fred

     
    • status: open --> closed-fixed