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

Compiling plugin for windows

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.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

Compiling plugin for windows Giuseppe Pasquino 13 Nov 00:45
  Compiling plugin for windows Tor Lillqvist 13 Nov 08:37
   Compiling plugin for windows Aurimas Juška 13 Nov 09:20
    Compiling plugin for windows Tor Lillqvist 13 Nov 10:30
     Compiling plugin for windows Tor Lillqvist 13 Nov 10:55
      Compiling plugin for windows Tor Lillqvist 13 Nov 11:44
Compiling plugin for windows Giuseppe Pasquino 13 Nov 10:08
Giuseppe Pasquino
2007-11-13 00:45:40 UTC (about 17 years ago)

Compiling plugin for windows

Hi all. I had develop a couple of plug-in and I need to compile it for windows... Can anyone can tell me how? Thanks
Giuseppe

Tor Lillqvist
2007-11-13 08:37:13 UTC (about 17 years ago)

Compiling plugin for windows

Hi all. I had develop a couple of plug-in and I need to compile it for windows... Can anyone can tell me how?

First tell us how you compiled it on Linux, and what kind of experience, if any, you have of development on Windows, and what tools, if any, you already have for that. (ILike, have you used Microsoft's Developer Studio and know your way around it very well, and have access to it? Or do you come from a Unix background only?)

--tml

Aurimas Juška
2007-11-13 09:20:07 UTC (about 17 years ago)

Compiling plugin for windows

I think it would be very useful if you could tell us how to compile using both Microsoft Visual Studio and msys/mingw32.

On Nov 13, 2007 9:37 AM, Tor Lillqvist wrote:

First tell us how you compiled it on Linux, and what kind of experience, if any, you have of development on Windows, and what tools, if any, you already have for that. (ILike, have you used Microsoft's Developer Studio and know your way around it very well, and have access to it? Or do you come from a Unix background only?)

Giuseppe Pasquino
2007-11-13 10:08:26 UTC (about 17 years ago)

Compiling plugin for windows

The plugin in only a small .c file. So the installation on Linux was simple...
But my professor at the university wants the plugin working on windows version of gimp too... My graduation depend on this... I've tried used the dev-c++ to compile the source but the program find a lot of error in "gimp.h".
But this is impossible...
I cannot access to microsoft's developer studio but I've already used it. So it is possible to use microsoft visual c++? How?

Giuseppe

----- Original Message ----- From: "Tor Lillqvist"
To: "Giuseppe Pasquino"
Cc:
Sent: Tuesday, November 13, 2007 8:37 AM Subject: Re: [Gimp-developer] Compiling plugin for windows

First tell us how you compiled it on Linux, and what kind of experience, if any, you have of development on Windows, and what tools, if any, you already have for that. (ILike, have you used Microsoft's Developer Studio and know your way around it very well, and have access to it? Or do you come from a Unix background only?)

--tml

Tor Lillqvist
2007-11-13 10:30:22 UTC (about 17 years ago)

Compiling plugin for windows

On 13/11/2007, Aurimas Juška wrote:

I think it would be very useful if you could tell us how to compile using both Microsoft Visual Studio and msys/mingw32.

Well, in a nutshell, you have to know what you are doing;) Short instructions:

Most importantly, the plug-in obviously must not use some POSIX-only or Linux-only APIs that are not available in the C library on Windows.

You will need the header files for GIMP and the ones they include (GTK+ and its dependencies), and import libraries for the DLLs that the plug-in uses. (If you don't know what an import library is, look in the interweb.)

As far as I know there is no distribution of a GIMP 2.4 developer package for Windows, unfortunately. But I think it should work fine to use headers and import libraries from GIMP 2.2, so get http://www.gimp.org/~tml/gimp/win32/gimp-dev-2.2.7.zip .

(I will shortly create a developer package for GIMP 2.4 and add a link to it on the http://www.gimp.org/~tml/gimp/win32/downloads.html page.)

Unzip the developer package in some suitably named new, empty folder.

You will also need developer packages for GTK+, Pango, atk and glib. Unzip them, too, in either the same, or separate folders.

With Visual Studio: set up a project that compiles the plug-in's source file(s), and pass the correct -I flags to the compiler so that it finds the header files, and the correct /libpath switches to the linker so that it finds the import libraries, and link with the correct libraries (the same ones you link with on Linux).

With MSYS: Basically do like on Linux. If you are using auto* and libtool on Linux (as you should), but have never used those on Windows before, it can be a pain to set them up. So maybe for a small, perhaps just a single source file, program like a GIMP plug-in you shouldn't bother. Just write a makefile from scratch that builds your plug-in. One thing you need to watch out for is the correct order of object (or source) files and -L and -l options on the command line. The non-traditional order allowed by gcc and ld on Linux don't work for ld on Win32.

To find out what the correct compiler and linker flags are, you can use the gimptool-2.0.exe program distributed with the gimp developer package. It requires that you also have the pkg-config program (available from the downloads.html web page mentioned above) and the PKG_CONFIG_PATH environment variable correctly set up, so if that causes a headache to you, it might be easier to just write the makefile from scratch.

You can use gimptool-2.0.exe also to find out the flags for the Microsoft compiler and linker. Just pass the --msvc-syntax flag to gimptool-2.0.exe. (But see above about pkg-config and PKG_CONFIG_PATH.)

So, in a nutshell, this is not rocket science. It's simply a matter of invoking the compiler with the right flags. I suggest staying away from tools like dev-cpp that try to make things easier but only succeed in preventing you from learning how things actually work. Dev-cpp etc might be fine for Your First Hello World program, but once you get past that, you need to get your fingers dirty. Feel free to disagree, of course.

--tml

Tor Lillqvist
2007-11-13 10:55:02 UTC (about 17 years ago)

Compiling plugin for windows

On 13/11/2007, Tor Lillqvist wrote:

I will shortly create a developer package for GIMP 2.4 and add a link to it on the http://www.gimp.org/~tml/gimp/win32/downloads.html page.

Now it is there: http://www.gimp.org/~tml/gimp/win32/gimp-dev-2.4.zip . Please test and tell me if something is missing.

--tml

Tor Lillqvist
2007-11-13 11:44:16 UTC (about 17 years ago)

Compiling plugin for windows

Now it is there: http://www.gimp.org/~tml/gimp/win32/gimp-dev-2.4.zip . Please test and tell me if something is missing.

Ah, I now see it needs some tweaking, Please hold on for a day or so until I have fixed the gimptool program to work better. (I hadn't looked at it for a long time...)

--tml