RSS/Atom feed Twitter
Site is read-only, email is disabled

plug-in compilation problem

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

plug-in compilation problem Cindy Huyser 31 Aug 18:34
  plug-in compilation problem Carol Spears 02 Sep 17:20
  plug-in compilation problem Sven Neumann 02 Sep 17:44
plug-in compilation problem Cindy Huyser 02 Sep 18:27
Cindy Huyser
2002-08-31 18:34:05 UTC (over 21 years ago)

plug-in compilation problem

Hello,

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 /usr/lib/gimp/1.2/plug-ins/plugin_name 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.

Thanks, Cindy Huyser

Carol Spears
2002-09-02 17:20:24 UTC (over 21 years ago)

plug-in compilation problem

hi :)
On 2002-08-31 at 1134.05 -0500, Cindy Huyser typed this:

/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

i don't know about the c plug-ins, but the scripted plug-ins need to satisfy some registration demands.

here is a tutorial to help to write c plugins for gimp: http://gimp-plug-ins.sourceforge.net/doc/Writing/html/plug-in.html

good luck! carol

ps -- what does your plug-in do?

Sven Neumann
2002-09-02 17:44:14 UTC (over 21 years ago)

plug-in compilation problem

Hi,

Cindy Huyser writes:

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

looks as if your plug-in doesn't specify PLUG_IN_INFO. Every plug-in needs to setup a global array of function pointers like this:

GimpPlugInInfo PLUG_IN_INFO = {
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run /* run_proc */
};

Salut, Sven

Cindy Huyser
2002-09-02 18:27:04 UTC (over 21 years ago)

plug-in compilation problem

Thanks to you both. At some time during my experimentation process, the file was overwritten and lost the PLUG_IN_INFO (along with everything else), and I hadn't thought to look at the file again, since I hadn't edited it. Thank goodness for CVS!

Thanks again, Cindy

looks as if your plug-in doesn't specify PLUG_IN_INFO. Every plug-in needs to setup a global array of function pointers like this:

GimpPlugInInfo PLUG_IN_INFO = {
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run /* run_proc */
};