Menu

#4 Compiler Error "reference to symbol 'fmod@@GLIBC_2.2.5'" on Ubuntu-Linux building GTK-Samples

v1.0_(example)
closed
nobody
None
1
2019-09-12
2015-07-08
No

Ubuntu 12.04 LTS with Harbour 3.0.0 an gcc
SVN Revision 2461

./build.sh example
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'example.prg'...
Lines 3417, Functions/Procedures 1
Generating C source output to 'example.c'... Done.
/usr/bin/ld: /home/logbuch/harbour/harbour-3.0.0/lib/linux/gcc/libhbvm.a(hvmall.o): undefined reference to symbol 'fmod@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Solution:
see apended samples/gtk_samples/build.sh
the system libs must be at the end of die library list.

correct line:
$HRB_BIN/harbour $1 -n -i$HRB_INC -i$HWGUI_INC -w2 -dLINUX $2
gcc $1.c -o$1 -I $HRB_INC -L $HRB_LIB -L $HWGUI_LIB -Wl,--start-group $HWGUI_LIBS $HARBOUR_LIBS -Wl,--end-group pkg-config --cflags gtk+-2.0 pkg-config gtk+-2.0 --libs $SYSTEM_LIBS

Wrong line

gcc $1.c -o$1 -I $HRB_INC -L $HRB_LIB -L $HWGUI_LIB $SYSTEM_LIBS -Wl,--start-group $HWGUI_LIBS $HARBOUR_LIBS -Wl,--end-group pkg-config --cflags gtk+-2.0 pkg-config gtk+-2.0 --libs

1 Attachments

Discussion

  • Alexander S.Kresin

    Hm... The current build.sh works normally here - used under Fedora 11 - 16 and Debian 6 - 7. Anyway, I moved the $SYSTEM_LIBS to the end of the line - this doesn't change anything for me, the script works normally, as before.

     
  • Wilfried Brunken

    Now, i tested under Ubuntu 18 and with the last version from the repository the samples and my application are compiled and start.
    I think, you can close this case
    73 und 55 de DF7BE

     
  • Alexander S.Kresin

    Ok

     
  • Alexander S.Kresin

    • status: open --> closed
     

Log in to post a comment.