XonX XonX - 10 months ago 56
C++ Question

Troubles with compiling with FLTK framework

I seem to have problems compiling FLTK programms using anything other than the fltk-config script.

I have copied the source from the "Hello world" program in the tutorial. When I run fltk-config --compile hello.cpp it prints out

g++ -I/usr/local/include -I/usr/local/include/FL/images -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE32_SOURCE -o 'hello' 'hello.cpp' -mwindows /usr/local/lib/libfltk.a -lole32 -luuid -lcomct132

and compiles just fine. But when I print in the same thing myself, it says, that ld.exe cannot find -lcomct132.

I use FLTK 1.3.0 compiled on MinGW under WinXP.

Answer Source

I bet that the fltk-config script is setting environment variables that you have not configured. Check the FLTK documentation and see the proper environment variables you need to set to compile without the helper script.

Edit: Did some research

Apparently you're not the only one that has linking problems. I found a similar problem on the forum here and on the fltk.general newsgroup. The consensus seems to be that order of the linking arguments are important, and that using the fltk-config script is the easiest way to proceed.