On 9 Jun 2010, at 18:45, newgen wrote:
> I switched under ubuntu from fltk 1.1 to 1.3. Now, my source throws
> a lot errors when linking:
How did you switch?
All but one of my linux boxes are now ubuntu (assorted versions from
8.04 onwards), and I've not had any problems with using fltk-1.3, so
I have to guess that something is hosed in your setup.
> undefined reference to `gl_font(int, int)'
> undefined reference to `Fl_Input::Fl_Input(int, int, int, int, char
> const*)'`Fl_Browser::add(char const*, void*)
> .. multiple times and a lot more. It seems the library is not found
> or not properly linked. I compile with:
I'd have to guess you link line is awry then...
> g++ main.cpp -o main -p -Wall -g -DLINUX `sdl-config --cflags` -
> I. `sdl-config --libs` -lSDL -lGL -lSDL_image -lglut -lGLU -L/usr/
> lib/mysql -lmysqlclient -lxerces-c -lssh -lpthread -lm /usr/local/
> lib/libfltk.a /usr/local/lib/libfltk_forms.a /usr/local/lib/
> libfltk_gl.a /usr/local/lib/libfltk_images.a `fltk-config --ldflags
> --cxxflags --use-gl` alotfiles.o
... and if that's the command you are using, I'm not all that
surprised. Where on earth did you get that monstrosity?
Things you need to sort...
- the gnu linker is order sensitive, so you *need* to link things in
the correct order. In particular you need to list the things that
depend on library functions, before the libs that provide those
functions. This extends to libs that depend on other libs too, or
course... For example, all your .o files should be before your .a
files, and libfltk_gl.a needs to be listed before libfltk.a, which in
turn needs to be listed before pthread, and so on...
- Are you actually using any SDL functions? If not, I'd take all the
SDL stuff out of the link, as it is likely they are setting different
paths and options than what fltk might want.
-- how many files are you actually compiling for this test? If only
the one, then the simple line:
fltk-config --compile main.cpp
will compile and link the file straight off.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk