undefined reference when install fltk 1.3.8 on ubuntu 22

98 views Asked by At

I'm learning C++ with Stroutrup's PPP book. I need to install fltk to follow up his lessions. After dowloading and upzip I ran: ./congiure I got this summary (It seems fine)

Configuration Summary
-------------------------------------------------------------------------
    Directories: prefix=/usr/local
                 bindir=${exec_prefix}/bin
                 datadir=${datarootdir}
                 datarootdir=${prefix}/share
                 exec_prefix=${prefix}
                 includedir=${prefix}/include
                 libdir=${exec_prefix}/lib
                 mandir=${datarootdir}/man
       Graphics: X11 + Xft + Xdbe + Xfixes + Xinerama + Xcursor + Xrender
Image Libraries: JPEG=System
                 PNG=System
                 ZLIB=System
    Large Files: YES
         OpenGL: YES
        Threads: YES
configure: creating ./config.status
config.status: creating makeinclude
config.status: creating fltk.list
config.status: creating fltk-config
config.status: creating fltk.spec
config.status: creating FL/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: creating FL/abi-version.h
config.status: FL/abi-version.h is unchanged

Then, I ran make I got a lot of undefined refence to...

undo.cxx: In function ‘char* undo_filename(int, char*, int)’:
undo.cxx:68:29: warning: ‘undo_’ directive output may be truncated writing 5 bytes into a region of size between 1 and 2048 [-Wformat-truncation=]
   68 |   snprintf(buf, bufsize, "%sundo_%d_%d.fl", undo_path, getpid(), level);
      |                             ^~~~~
In file included from /usr/include/stdio.h:894,
                 from ../FL/fl_utf8.h:34,
                 from ../FL/Fl.H:32,
                 from undo.cxx:19:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:35: note: ‘__builtin___snprintf_chk’ output between 12 and 2079 bytes into a destination of size 2048
   71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 |        __glibc_objsize (__s), __fmt,
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |        __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~           
Compiling widget_panel.cxx...
Linking fluid...
/usr/bin/ld: Fl_Function_Type.o: in function `Fl_Decl_Type::make()':
Fl_Function_Type.cxx:(.text._ZN12Fl_Decl_Type4makeEv+0x34): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: Fl_Function_Type.o: in function `Fl_Code_Type::make()':
Fl_Function_Type.cxx:(.text._ZN12Fl_Code_Type4makeEv+0x45): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: Fl_Function_Type.o: in function `Fl_Class_Type::~Fl_Class_Type()':
Fl_Function_Type.cxx:(.text._ZN13Fl_Class_TypeD0Ev[_ZN13Fl_Class_TypeD5Ev]+0x21): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: Fl_Function_Type.o: in function `Fl_Comment_Type::~Fl_Comment_Type()':
Fl_Function_Type.cxx:(.text._ZN15Fl_Comment_TypeD0Ev[_ZN15Fl_Comment_TypeD5Ev]+0x21): undefined reference to `operator delete(void*, unsigned long)'
.
.
.
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNG_Image.o): in function `Fl_PNG_Image::~Fl_PNG_Image()':
Fl_PNG_Image.cxx:(.text._ZN12Fl_PNG_ImageD0Ev[_ZN12Fl_PNG_ImageD5Ev]+0x21): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNG_Image.o): in function `Fl_PNG_Image::load_png_(char const*, unsigned char const*, int)':
Fl_PNG_Image.cxx:(.text._ZN12Fl_PNG_Image9load_png_EPKcPKhi+0x323): undefined reference to `operator new[](unsigned long)'
/usr/bin/ld: Fl_PNG_Image.cxx:(.text._ZN12Fl_PNG_Image9load_png_EPKcPKhi+0x356): undefined reference to `operator new[](unsigned long)'
/usr/bin/ld: Fl_PNG_Image.cxx:(.text._ZN12Fl_PNG_Image9load_png_EPKcPKhi+0x3b6): undefined reference to `operator delete[](void*)'
/usr/bin/ld: Fl_PNG_Image.cxx:(.text._ZN12Fl_PNG_Image9load_png_EPKcPKhi+0x400): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNG_Image.o):(.data.rel.ro._ZTI12Fl_PNG_Image[_ZTI12Fl_PNG_Image]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNM_Image.o): in function `Fl_PNM_Image::~Fl_PNM_Image()':
Fl_PNM_Image.cxx:(.text._ZN12Fl_PNM_ImageD0Ev[_ZN12Fl_PNM_ImageD5Ev]+0x21): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNM_Image.o): in function `Fl_PNM_Image::Fl_PNM_Image(char const*)':
Fl_PNM_Image.cxx:(.text._ZN12Fl_PNM_ImageC2EPKc+0x294): undefined reference to `operator new[](unsigned long)'
/usr/bin/ld: ../lib/libfltk_images.a(Fl_PNM_Image.o):(.data.rel.ro._ZTI12Fl_PNM_Image[_ZTI12Fl_PNM_Image]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:51: fluid] Error 1
make[1]: Leaving directory '/home/danhpc/Downloads/fltk-1.3.8-source/fltk-1.3.8/fluid'
make: *** [Makefile:22: all] Error 1

It seems like everything went bad when the linking process begins.

I tried install older versions. I tried installing all the dependencies like

  sudo apt-get install autoconf
  sudo apt-get install libx11-dev
  sudo apt-get install libglu1-mesa-dev
  
These two are optional, but highly recommended:  
  
  sudo apt-get install libasound2-dev
  sudo apt-get install libxft-dev

I even tried install different GUI library like wxwidget the still have the same problem. I expect to get install successfully and the test running would be OK. Any help would be much appreciated

0

There are 0 answers