----- Original Message ---- From: ere wer <[EMAIL PROTECTED]> To: clutter <[email protected]> Sent: Saturday, August 9, 2008 1:34:31 AM Subject: [clutter] [win32] Problem linking without libtool
I get "undefined reference to" all _gl* functions when trying to compile: $ gcc -o mytest test-actors.c `pkg-config clutter-0.8 --cflags --libs` C:/dev/msys/lib/libclutter-win32-0.8.a(clutter-main.o): In function `_clutter_do_pick': C:/dev/msys/src/clutter/clutter/clutter/clutter-main.c:367: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/src/clutter/clutter/clutter/clutter-main.c:377: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/src/clutter/clutter/clutter/clutter-main.c:382: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/src/clutter/clutter/clutter/clutter-main.c:388: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/lib/libclutter-win32-0.8.a(clutter-stage.o): In function `clutter_stage_read_pixels': C:/dev/msys/src/clutter/clutter/clutter/clutter-stage.c:1177: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/src/clutter/clutter/clutter/clutter-stage.c:1195: undefined reference to [EMAIL PROTECTED]' C:/dev/msys/lib/libclutter-win32-0.8.a(cogl.o): In function `cogl_get_proc_address': ... ... ... However when using libtool --mode=link (as suggested here http://www.busydoingnothing.co.uk/blog) it compiles and links fine. It seems the problem is finding the gl libs... but do not even know where to look for them (in mingw? in msys? in some system dir?). Please clarify the situation for me. And another question: Why the "redhand.png" image fails to load when dubble clicking the .exe (of some test sample using it) , or calling the exe from windows cmd? 10x! MihailNajdenov -------------------------------------- SOLVED: One must add opengl winmm gdi32 libs when compiling: $ gcc test-actors.c -o test-actors `pkg-config --cflags --libs clutter-0.8` -lopengl32 -lgdi32 -lwinmm WARNING: The input file (test-actors.c) param must NOT be the last param OR placed between `pkg-config ... ` and the added libs (-l* )! Otherwise it will trow the exact same error as no libs ware added! VALA: To compile straight to binary with valac: $ valac --cc=gcc --Xcc=-lopengl32 --Xcc=-lgdi32 --Xcc=-lwinmm -o test-actors test-actors.vala --vapidir=../clutter --pkg=clutter-0.8 SOLVED ALTERNATIVE: In your /libs/pkgconfig folder find the clutter-0.8.pc file and find the "Libs:" line. Than just add the exact same libs te same way at the end of the line and save: Libs: -L${libdir} -lclutter-${backend}-${apiversion} -lopengl32 -lgdi32 -lwinmm NOTE to the clutter devs: Is this an ugly hack?(pangowin32.pc does it, adding "-lgdi32" the same way) Can this be done by default when building for windows backend(s)? Then compile as normal: $ gcc test-actors.c -o test-actors `pkg-config --cflags --libs clutter-0.8` VALA: $ valac --cc=gcc -o test-actors test-actors.vala --vapidir=../clutter --pkg=clutter-0.8 hope thats all! MihailNajdenov -- To unsubscribe send a mail to [EMAIL PROTECTED] -- To unsubscribe send a mail to [EMAIL PROTECTED]
