Re: [fltk.general] Re: I just installed FLTK on Linux but I have a compile error

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: I just installed FLTK on Linux but I have a compile error Albrecht Schlosser 07:58 Oct 22 top right image
 
On 10/22/20 3:58 PM ken williams wrote:
It seems I can't compile it with g++ ...
I tried this:

    g++ hello.cpp -o hello -I/usr/local/include -L/usr/local/lib -lfltk -lXext -lX11 -lm

and I get this:

    /usr/bin/ld: /usr/local/lib/libfltk.a(Fl_X11_Window_Driver.cxx.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'     /usr/bin/ld: /usr/lib/libdl.so.2: error adding symbols: DSO missing from command line
     collect2: error: ld returned 1 exit status

Could someone tell me what I should add or change?

That particular error is (AFAICT) because you missed to include '-ldl' in your command.

A more general approach would be to use either

$ fltk-config --compile hello.cxx

and learn from the output which options you need or to use fltk-config to provide the necessary options for you, like this:

$ fltk-config --cxxflags
$ fltk-config --ld[static]flags

See docs and/or

$ fltk-config --help

for more info.

Thank you!

Welcome.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/300af06c-bf07-c441-7831-e03836b642fb%40online.de.
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2020 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.