Duncan Gibson wrote:
>>>>> g++  hello.cxx [...] -lfltk_images  -lfltk
>>>>> produces:
>>>>> /tmp/ccBlyRgP.o: In function `main':
>>>>> hello.cxx:(.text+0x44): undefined reference to
>>>>> `fltk::Window::Window(int, ...
> 
>>> fltk-1.3 and fltk-2 are completely different beasts, so don't confuse
>>> them or think that they are interchangable. [...]
>>> To discover the compiler and linker flags that are appropriate for
>>> your installation, use 'fltk-config' for fltk-1.x, and 'fltk2-config'
>>> for fltk-2.
> 
>> Well, thanks Duncan, but that's quit obvious or I wouldn't have got
>> to the link stage at all. I installed fltk 2, tried that example and
>> got the problem above. I uninstalled it, installed 1.3 tried the 1.3
>> example with the same problems.
> 
> My apologies, but it's not obvious to some people who post here.
> 
> Some people also come unstuck by having multiple versions of fltk-1.1.x
> and/or fltk-1.3.x installed where include files and libraries might not
> match or where they built and installed them with different options.
> 
> Final suggestion from me:
> Does fltk-config* --ldflags return non-standard -L options that you
> will need to give to the linker so that it can find the libraries?

... and two more from me:

Is there any chance that your installed libs (you wrote that you "installed" 
them, i.e. did not compile them yourself?) might have been compiled with a 
different compiler version? If so, try compiling them yourself and see what
happens.

It is also not obvious if you tried to link with gcc/g++ before you tried
to use ld. I don't know what happens "under the hood", but generally it
is not recommended to link with ld, but instead use the compiler frontend
to drive the linker, e.g.

g++ -o hello hello.cxx `fltk(2)-config --cxxflags --ldflags` should work.

If this doesn't work, please post the exact error messages.

You can even use the generated fltk(2)-config in the fltk source directory
without installing it for testing. That's what I do often to compile and
link with different fltk (test/development) versions.

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

Reply via email to