It's easy, and thankfully doesn't involve building GIMP itself.
Libs for glib, gobject and gtk-win32 can be found ready-made in the GTK source tree.
lib /def:whatever.def /out:whatever.lib /machine:x86. This will generate static libraries that you can link against.C:\gimp-2.6.11;C:\gtk+-2.22.0\include\glib-2.0;C:\gtk+-2.22.0\lib\glib-2.0\include;C:\gtk+-2.22.0\include;C:\gtk+-2.22.0\include\gtk-2.0;C:\gtk+-2.22.0\include\cairo;C:\gtk+-2.22.0\include\pango-1.0;C:\gtk+-2.22.0\lib\gtk-2.0\include;C:\gtk+-2.22.0\include\gdk-pixbuf-2.0;C:\gtk+-2.22.0\include\atk-1.0Windows (/SUBSYSTEM:WINDOWS) (prevents a console window from briefly popping up)copy "$(TargetPath)" "$(USERPROFILE)\.gimp-2.6\plug-ins\"Unless I've forgotten something you can now build a Windows plug-in. Just bear in mind that you're writing C code, which has some limitations compared to C++ (like requiring variables to be declared at the top of code blocks). In theory C++ can be used, but I never worked out how to solve the errors trying to compile CPP files creates.
Debugging isn't straightforward because you are compiling separate executables, which the VS debugger won't catch when GIMP launches them. If you have Visual Studio you can use the just-in-time debugger, but if you've got C++ Express you don't have that luxury. I've found that the best solution is this:
#ifdef _DEBUG
// Poor man's JIT debugger!
while(1) {}
#endif
Start your plug-in, use Attach to Process, pause execution, then drag the yellow arrow out of the loop manually. You may need to add _DEBUG to your preprocessor definitions manually too (in Debug mode only, as this trick won't work in Release builds).
Recent comments