Starting with Win32 plug-in development
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.
Starting with Win32 plug-in development | Arnaud Darmont | 28 Jul 14:52 |
Starting with Win32 plug-in development | Sven Neumann | 28 Jul 17:14 |
Starting with Win32 plug-in development | Arnaud Darmont | 29 Jul 14:16 |
Starting with Win32 plug-in development | Sven Neumann | 29 Jul 15:19 |
Starting with Win32 plug-in development | Tor Lillqvist | 29 Jul 17:53 |
Starting with Win32 plug-in development
Dear all,
i'm new to gimp plug-in developments, and i'd like to first be able to
compile the plug-in template before starting to write my own code (seems
obvious...).
Here are the steps i have done and the problems i'm facing.Please tell me
where i'm wrong.
I have downloaded the following files and extracted them in
D:\temp\gimp\dev\ keeping the directory structure:
atk-1.0.9.zip
atk-dev-1.9.0.zip
gimp-2.2.1.tgz
glib-2.6.5.zip
glib-dev-2.6.5.zip
gtk+-2.6.8.zip
gtk+-dev-2.6.8.zip
pango-dev-1.8.2.zip
pango-1.8.2.zip
All necessary directories have been added to the include path so that most
of the header files can be linked.
I only have one missing file: libintl.h Where can i get it?
Then i have added the following (currently dummies) in main.h to solve some
undefined variable errors:
#define PLUGIN_NAME "EVB Interface"
#define LOCALEDIR "."
#define DATADIR "."
There is one file linked which is config.h that i cannot find in the plug-in template. I assume that it should contain just the above? Or should it be gimp's config.h.win32?
Compiling gives about 50 warnings but no errors. I'll look into them later. Currently i have a lot of linker error similar to "interface.obj : error LNK2001: unresolved external symbol _gimp_chain_button_get_active". I guess some of the libraries should be installed (in a windows sense) and not just extracted/compiled and configured like Linux does.
I have added all .lib files i've found in my D:\temp\gimp\dev\ to the project but the missing dependencies errors remain.
Does someone have a kind of step-by-step procedure or cookbook like win32-gimp-plug-in-development-tutorial-for-real-dummies?
I'm currently working with Visual C++, but i also have Borland C++ Builder and Dev-C++ available.
Thank you and best regards, Arnaud Darmont.
Starting with Win32 plug-in development
Hi,
Arnaud Darmont writes:
Then i have added the following (currently dummies) in main.h to solve some undefined variable errors:
#define PLUGIN_NAME "EVB Interface"
#define LOCALEDIR "."
#define DATADIR "."
That won't work. You should use the values you get using pkg-config:
pkg-config --variable=gimpdatadir gimp-2.0 pkg-config --variable=gimplocaledir gimp-2.0
"pkg-config --variable=prefix gimp-2.0" might also be useful.
There is one file linked which is config.h that i cannot find in the plug-in template. I assume that it should contain just the above? Or should it be gimp's config.h.win32?
config.h is supposed to be generated by the scripts configure script. If you don't want to use configure, you can probably get away w/o config.h for most plug-ins.
Does someone have a kind of step-by-step procedure or cookbook like win32-gimp-plug-in-development-tutorial-for-real-dummies?
The GIMP wiki has pages on compiling gimp on win32.
I'm currently working with Visual C++, but i also have Borland C++ Builder and Dev-C++ available.
The plug-in template and most other plug-ins assume that you are using cygwin or mingw.
Sven
Starting with Win32 plug-in development
Hi,
I'm now using Dev-C++ that is MinGW based. The compiling still goes well (i have had to make some minor changes to the code) but i get the same linker errors (pasted below). It seems that i'm missing some lib files from gimp and gtk2+. I don't want to build those softwares completely, could someone send me the necessary LIBs?
Thank you.
Best regards, Arnaud Darmont.
Compiler: Default compiler
Building Makefile: "Makefile.win"
Executing make...
make.exe -f "Makefile.win" all
g++.exe ../interface.o ../main.o ../render.o -o "EVB90267.exe"
-L"D:/Dev-Cpp/lib"
../interface.o(.text+0x2a):interface.c: undefined reference to `gimp_ui_init'
../interface.o(.text+0x6e):interface.c: undefined reference to
`gimp_standard_help_func'
../interface.o(.text+0x8e):interface.c: undefined reference to
`gimp_dialog_new'
../interface.o(.text+0xa5):interface.c: undefined reference to `gtk_vbox_new'
../interface.o(.text+0xad):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0xbc):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xcc):interface.c: undefined reference to
`gtk_container_set_border_width'
../interface.o(.text+0xd1):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0xd8):interface.c: undefined reference to
`gtk_dialog_get_type'
../interface.o(.text+0xe7):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xf9):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x10a):interface.c: undefined reference to
`gtk_container_add'
../interface.o(.text+0x11e):interface.c: undefined reference to
`gimp_frame_new'
../interface.o(.text+0x126):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x135):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x15e):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x169):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x185):interface.c: undefined reference to `gtk_table_new'
../interface.o(.text+0x18d):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x19c):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x1ac):interface.c: undefined reference to
`gtk_table_set_col_spacings'
../interface.o(.text+0x1b1):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x1c0):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x1d0):interface.c: undefined reference to
`gtk_table_set_row_spacings'
../interface.o(.text+0x1d5):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x1e4):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x1f5):interface.c: undefined reference to
`gtk_container_add'
../interface.o(.text+0x200):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x228):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x237):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x2ba):interface.c: undefined reference to
`gimp_scale_entry_new'
../interface.o(.text+0x2dc):interface.c: undefined reference to
`gimp_int_adjustment_update'
../interface.o(.text+0x2ef):interface.c: undefined reference to
`g_signal_connect_data'
../interface.o(.text+0x310):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x31f):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x3a3):interface.c: undefined reference to
`gimp_scale_entry_new'
../interface.o(.text+0x3c8):interface.c: undefined reference to
`gimp_int_adjustment_update'
../interface.o(.text+0x3db):interface.c: undefined reference to
`g_signal_connect_data'
../interface.o(.text+0x3fc):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x40b):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x493):interface.c: undefined reference to
`gimp_scale_entry_new'
../interface.o(.text+0x4b8):interface.c: undefined reference to
`gimp_int_adjustment_update'
../interface.o(.text+0x4cb):interface.c: undefined reference to
`g_signal_connect_data'
../interface.o(.text+0x4df):interface.c: undefined reference to
`gimp_frame_new'
../interface.o(.text+0x4e7):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x4f6):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x51f):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x52a):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x53e):interface.c: undefined reference to `gtk_hbox_new'
../interface.o(.text+0x546):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x555):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x566):interface.c: undefined reference to
`gtk_container_add'
../interface.o(.text+0x571):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x589):interface.c: undefined reference to
`gimp_random_seed_new'
../interface.o(.text+0x591):interface.c: undefined reference to
`gtk_widget_get_type'
../interface.o(.text+0x5a6):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x5b6):interface.c: undefined reference to
`g_object_get_data'
../interface.o(.text+0x5c2):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x5da):interface.c: undefined reference to
`gtk_widget_set_size_request'
../interface.o(.text+0x5df):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x5ee):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x617):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x622):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x636):interface.c: undefined reference to
`gimp_frame_new'
../interface.o(.text+0x63e):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x64d):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x676):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x681):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x695):interface.c: undefined reference to `gtk_hbox_new'
../interface.o(.text+0x69d):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x6ac):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x6bc):interface.c: undefined reference to
`gtk_container_set_border_width'
../interface.o(.text+0x6c1):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x6d0):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x6e1):interface.c: undefined reference to
`gtk_container_add'
../interface.o(.text+0x6ec):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x6f7):interface.c: undefined reference to
`gimp_image_get_unit'
../interface.o(.text+0x713):interface.c: undefined reference to
`gimp_image_get_resolution'
../interface.o(.text+0x818):interface.c: undefined reference to
`gimp_coordinates_new'
../interface.o(.text+0x820):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x82f):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x858):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x863):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x877):interface.c: undefined reference to
`gimp_frame_new'
../interface.o(.text+0x87f):interface.c: undefined reference to
`gtk_box_get_type'
../interface.o(.text+0x88e):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x8b7):interface.c: undefined reference to
`gtk_box_pack_start'
../interface.o(.text+0x8c2):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x8de):interface.c: undefined reference to `gtk_table_new'
../interface.o(.text+0x8e6):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x8f5):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x905):interface.c: undefined reference to
`gtk_container_set_border_width'
../interface.o(.text+0x90a):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x919):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x929):interface.c: undefined reference to
`gtk_table_set_col_spacings'
../interface.o(.text+0x92e):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x93d):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x94d):interface.c: undefined reference to
`gtk_table_set_row_spacings'
../interface.o(.text+0x952):interface.c: undefined reference to
`gtk_container_get_type'
../interface.o(.text+0x961):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x972):interface.c: undefined reference to
`gtk_container_add'
../interface.o(.text+0x97d):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0x998):interface.c: undefined reference to
`gimp_layer_combo_box_new'
../interface.o(.text+0x9a0):interface.c: undefined reference to
`gimp_int_combo_box_get_type'
../interface.o(.text+0x9af):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0x9c0):interface.c: undefined reference to
`gimp_int_combo_box_get_active'
../interface.o(.text+0x9d1):interface.c: undefined reference to
`gimp_int_combo_box_connect'
../interface.o(.text+0x9e4):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0x9f3):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xa3e):interface.c: undefined reference to
`gimp_table_attach_aligned'
../interface.o(.text+0xa52):interface.c: undefined reference to
`gimp_image_combo_box_new'
../interface.o(.text+0xa5a):interface.c: undefined reference to
`gimp_int_combo_box_get_type'
../interface.o(.text+0xa69):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xa7a):interface.c: undefined reference to
`gimp_int_combo_box_get_active'
../interface.o(.text+0xa89):interface.c: undefined reference to
`gimp_int_combo_box_connect'
../interface.o(.text+0xa9c):interface.c: undefined reference to
`gtk_table_get_type'
../interface.o(.text+0xaab):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xaf6):interface.c: undefined reference to
`gimp_table_attach_aligned'
../interface.o(.text+0xb01):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0xb0c):interface.c: undefined reference to
`gtk_widget_show'
../interface.o(.text+0xb11):interface.c: undefined reference to
`gimp_dialog_get_type'
../interface.o(.text+0xb20):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xb28):interface.c: undefined reference to
`gimp_dialog_run'
../interface.o(.text+0xb53):interface.c: undefined reference to
`g_type_check_instance_cast'
../interface.o(.text+0xb63):interface.c: undefined reference to
`g_object_get_data'
../interface.o(.text+0xb6b):interface.c: undefined reference to
`gimp_chain_button_get_active'
../interface.o(.text+0xb78):interface.c: undefined reference to
`gtk_widget_destroy'
../interface.o(.text+0xb97):interface.c: undefined reference to
`_imp__libintl_gettext'
../interface.o(.text+0xbad):interface.c: undefined reference to
`gimp_image_base_type'
../main.o(.text+0x29):main.c: undefined reference to `gimp_main'
../main.o(.text+0x76):main.c: undefined reference to `gimp_main'
../main.o(.text+0x92):main.c: undefined reference to
`gimp_plugin_domain_register'
../main.o(.text+0xae):main.c: undefined reference to `g_build_filename'
../main.o(.text+0xcc):main.c: undefined reference to `g_filename_to_uri_utf8'
../main.o(.text+0xda):main.c: undefined reference to `g_free'
../main.o(.text+0xed):main.c: undefined reference to
`gimp_plugin_help_register'
../main.o(.text+0x159):main.c: undefined reference to `gimp_install_procedure'
../main.o(.text+0x16d):main.c: undefined reference to
`gimp_plugin_menu_register'
../main.o(.text+0x1d5):main.c: undefined reference to `gimp_drawable_get'
../main.o(.text+0x2e5):main.c: undefined reference to `g_random_int'
../main.o(.text+0x303):main.c: undefined reference to
`gimp_procedural_db_get_data'
../main.o(.text+0x317):main.c: undefined reference to
`gimp_procedural_db_get_data'
../main.o(.text+0x36a):main.c: undefined reference to
`gimp_procedural_db_get_data'
../main.o(.text+0x378):main.c: undefined reference to `g_random_int'
../main.o(.text+0x3c1):main.c: undefined reference to `gimp_displays_flush'
../main.o(.text+0x3e3):main.c: undefined reference to
`gimp_procedural_db_set_data'
../main.o(.text+0x3ff):main.c: undefined reference to
`gimp_procedural_db_set_data'
../main.o(.text+0x40a):main.c: undefined reference to `gimp_drawable_detach'
../main.o(.text+0x42f):main.c: undefined reference to
`_imp__libintl_textdomain'
../main.o(.text+0x44c):main.c: undefined reference to
`_imp__libintl_bindtextdomain'
../render.o(.text+0x26):render.c: undefined reference to `g_log'
../render.o(.text+0x39):render.c: undefined reference to
`_imp__libintl_gettext'
collect2: ld returned 1 exit status
make.exe: *** [EVB90267.exe] Error 1
Execution terminated
At 17:14 28/07/2005, Sven Neumann wrote:
Hi,
Arnaud Darmont writes:
Then i have added the following (currently dummies) in main.h to solve some undefined variable errors:
#define PLUGIN_NAME "EVB Interface"
#define LOCALEDIR "."
#define DATADIR "."That won't work. You should use the values you get using pkg-config:
pkg-config --variable=gimpdatadir gimp-2.0 pkg-config --variable=gimplocaledir gimp-2.0
"pkg-config --variable=prefix gimp-2.0" might also be useful.
There is one file linked which is config.h that i cannot find in the plug-in template. I assume that it should contain just the above? Or should it be gimp's config.h.win32?
config.h is supposed to be generated by the scripts configure script. If you don't want to use configure, you can probably get away w/o config.h for most plug-ins.
Does someone have a kind of step-by-step procedure or cookbook like win32-gimp-plug-in-development-tutorial-for-real-dummies?
The GIMP wiki has pages on compiling gimp on win32.
I'm currently working with Visual C++, but i also have Borland C++ Builder and Dev-C++ available.
The plug-in template and most other plug-ins assume that you are using cygwin or mingw.
Sven
Starting with Win32 plug-in development
Hi,
Arnaud Darmont writes:
I'm now using Dev-C++ that is MinGW based. The compiling still goes well (i have had to make some minor changes to the code) but i get the same linker errors (pasted below). It seems that i'm missing some lib files from gimp and gtk2+. I don't want to build those softwares completely, could someone send me the necessary LIBs?
Looks like you are not linking with libgimpui. Hard to guess what you are doing wrongly since you don't provide much information on what you are doing.
Sven
Starting with Win32 plug-in development
Arnaud Darmont writes:
> It seems that i'm missing some lib files from gimp
> and gtk2+. I don't want to build those softwares completely, could someone
> send me the necessary LIBs?
Go to www.gimp.org/win32/downloads.html for developer packages (headers, import libraries) for GTK+, Pango, atk and GLib. You will also need the gettext package if I recall correctly. Also get the pkg-config package.
Fetch www.gimp.org/win32/gimp-dev-2.2.7.zip for GIMP headers and import libraries. (Although is says 2.2.7, this should work fine for GIMP 2.2.8, too, as the API doesn't change.)
The easiest (IMHO) way to compile a (simple) GIMP plug-in is with the gimptool command (gimptool-2.0.exe) included in the above gimp-dev zipfile. Assuming your environment is set up sensibly, the command:
gimptool-2.0 --build plugin.c
should compile and link the GIMP plu-in plugin.c. No need for any IDE where you have to set include paths and libraries manually.
(But the requirement that the environment is set up sensibly is perhaps a stumbling block...)
--tml