Hello all,

As some surely had read, I had problems compiling and linking the fltk
example in two steps. The following makefile didn't work:

------------
CC = $(shell fltk-config --cxx)

CXXFLAGS = $(shell fltk-config --cxxflags)

LDFLAGS = $(shell fltk-config --ldflags)

hello : hello.o

clean :
        for f in hello.o hello; do if [ -f $$f ]; then rm $$f; fi; done
-----------

The reason is, that the the build in rule gives $(LDFLAGS) befor the .o
files. Because ld works in one pass, it cannot resolve the symbols in
the .o files using the libraries.

The following makefile does the job:

-------------
CC = $(shell fltk-config --cxx)

CXXFLAGS = $(shell fltk-config --cxxflags)

LDLIBS = $(shell fltk-config --ldflags)

hello : hello.o

clean :
        for f in hello.o hello; do if [ -f $$f ]; then rm $$f; fi; done
-------------

$(LDLIBS) comes after the .o files. So I would suggest an option --ldlibs
for the libraries.

Greetings, Dieter

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to