Page 1 of 1
Compiling for IM support on Win32/64
Posted: 2014-07-21T12:52:57-07:00
by kirash4
Somehow it feels like I've been down this path before ... I'm trying to build some command line utilities (for the moment) that need IM support to manipulate images. I'm using CodeBlocks to compile them (written in C++). I downloaded and installed the MinGW distribution of IM so I can compile and link to. Compilation works, no errors. But when I try to run the executable, that's when I run into missing libraries. From the looks of it, I'm going to need all the various image and compression libraries that this specific MinGW version of IM has support for. So I'm wondering if there's a MinGW distribution that has everything statically linked, or should I even bother considering the file size would be much larger at that point? Or should I be collecting all the various library sources and compiling them on my system?
Re: Compiling for IM support on Win32/64
Posted: 2014-07-30T10:53:49-07:00
by snibgo
I know nothing about CodeBlocks.
I know a little about MinGW tools, as I use them for my own C++ software. But I know nothing about the MinGW distro of IM. I do remember once trying to build IM and failing because of all the libraries. Perhaps that was with the MinGW distro and tools.
However, both IM distros at
http://www.imagemagick.org/script/install-source.php build successfully with the Cygwin toolset. They might build with MinGW tools. There are two distros: Unix and Windows. When compiled with Cygwin, there seems to be no difference.
The resulting programs are almost exactly equivalent to the official IM binaries for Windows. The only difference I have found so far concerns using forward-slashes in paths.
I would have replied a week ago but I only discovered this today. My first-ever successful build of IM! Whoppee!
Re: Compiling for IM support on Win32/64
Posted: 2014-07-30T11:37:05-07:00
by kirash4
Yeah, I actually ditched MinGW. I went the CygWin route and now have a static build of IM with only the specific libraries that I need/want (freetype/libjbig/libjpeg/libpng/libz.) Rather painless as all of the libraries can also be compiled statically. Now I'm down to only needing three CygWin specific DLLs for my executables to work. I'm happy with that. The MinGW prebuilt library has everything shared, which results in the need for several DLLs, as well as the added stuff I don't need/want.
Code::Blocks is just an IDE that happens to have MinGW built-in, but can be configured to use whatever other compiler you happen to prefer. In my case, I have it configured to use CygWin (both 32 and 64 bits.) And since I share my project files with my Unix platform, I can open C::B there, open the project file, select the Unix build options and hit compile - it will use the unix compiler at that point.