I have for some time been successful in building C plug-ins and
installing them with gimptool --install-admin plugin_name.c. The
command output echoed by this call is
/usr/bin/gcc -g -O2 -Wall -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2
-I/usr/lib/glib/include -I/usr/X11R6/include -o
plugin_name.c -L/usr/lib -lgimpui -lgimp -L/usr/X11R6/lib -lgtk -lgdk
-rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
Now, I need to link an additional library into my plug-in. I built a
makefile, setting CFLAGS to the include directories called by gimptool
and LDFLAGS to gimptool's library calls (I did not yet add in the
desired additial library). When I ran the makefile against my plug-in,
I received the following error:
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/usr/lib/libgimp.so: undefined reference to `PLUG_IN_INFO'
collect2: ld returned 1 exit status
Strange. So I tried the simplest command-line version of the compiler
call I could find:
gcc -o plugin_name `gimptool --libs --cflags` plugin_name.c
and got the same error. Worse, now, after a bit more experimentation
(changing the order of library calls in the makefile to try to match up
each -L search path with the libraries to be found there), even
gimptool --install-admin plugin_name.c
results in the above error. gimptool was not edited during this process.
Any insights? My Gimp version is 1.2.1, under Red Hat Linux 6.2.
Gimp-developer mailing list