CHAPTER 11 (Top web site) PLUG-INS AND SCRIPTING 421 Compiling
CHAPTER 11 PLUG-INS AND SCRIPTING 421 Compiling makes a C plug-in run much faster than a script, since the compiler speaks the machine s native language. However, it also means there s an extra step in creating something that can run, and it has to be done separately for each platform. If there s a binary available for your operating system, just take that file and move it to the plug-ins folder inside your GIMP profile. Alternately, if you have gimptool installed, you can use gimptool –install-bin. The next time you restart GIMP, the new plug-in should show up in the menus. Tip Where did the new plug-in show up? A lot of plug-in developers forget to tell you where to look in the menus to find their plug-in once it s installed. Since GIMP has so many features already, searching for something new could take quite a while! Fortunately, you can use the Plug-In Browser to figure out where it appears. However, since many plug-in developers don t have C compilers for all three platforms, often they simply make the C source code available, and you have to build (compile) it yourself. You ll need some supporting programs in order to do that. Installing a Gimp C Development Environment On Mac and Linux systems, installing a C compiler is easy. The GNU C compiler (gcc) comes on the Mac OS X Development CD, and is included with most Linux distributions. If it s not installed, it can usually be installed easily using the software update tools provided with your system. You ll probably need a few additional packages, in particular gimptool. It s sometimes included with GIMP, but if not, look for a package called something like gimp-dev or gimp-devel. You ll also need development packages for X11 and gtk. Most packaging systems should automatically install these when you install the GIMP development package, but if you get errors, these packages may be what you re lacking. On Windows it s a bit harder, since Windows doesn t come with a C compiler. If you don t already have a compiler installed, you re probably best off with MinGW, the Minimalist GNU for Windows packages. Find them at http://www.mingw.org/. You will need both MinGW and MSYS. In addition, even if you already had a compiler, you ll need the development libraries for GTK+, Glib, and other related features. You can get them by clicking on GIMP for Windows on the main gimp.org site. Look for packages with -dev in the name. Building a C Plug-In Once you have the compiler and libraries installed, it s time to build your plug-in. You ll need a terminal window open so you can type commands: the Command Prompt program should work on Windows systems, Terminal on Macs, or any terminal client on Linux. Then type: gimptool –build filename.c where filename.c is the name of the plug-in file. Remember: two dashes, not just one. If this gives errors, it may be that you re missing libraries. Double-check that you have all the requirements installed.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.