Archive for August 4th, 2008

GOCR for Windows From Linux

My last post was a major screw up. I admit it. Maybe I was high, but whatever I posted some shit, someone called me out on it. Ah well, big deal. I post some good stuff I reckon. Totally for free. If you can’t read through some of my bullshit to get to it then I will clean you up the proper info for a small fee of $600. But I guess you’re all just going to have to read my shit along with the good stuff. Am I retarded? Hell yeah. But I don’t give a fuck.

Anyway instead of rebooting your pc everytime you want to compile a program for windows it’s actually possible to compile straight from Linux with wine. This includes ImageMagick programs. Now I’m not sure but I think some other folks have tutorials on similar stuff but it’s a pain to get imagemagick included as well. Here’s how you do it.

Go download dev-cpp we’ll use this as our IDE

Now go get the latest MingW. You’ll know you’ve got the right one because in dev-cpp/bin/ you’ll find a load of same named files as in MinGW/bin/.

Copy the files from MinGW/bin/ over the dev-cpp/bin/ directory. This is basically an update of MinGW. Oh yeah copy over the libraries (lib/) too, I’m pretty sure you need those. Something about gettimeofday() not being present in older versions of mingw.

Download the ImageMagick for MinGW install. It’s listed under the unix binaries but runs on windows. No idea why. Anyway this will install a directory with some libraries in it. Libraries are files that have an .a extension like libMagick.a

Ok right if you’ve done all that you can go ahead and run Dev-Cpp. Like this (Make sure you’ve installed it using wine:

user[~]$ cd .wine/drive_c/Dev-Cpp/

user[Dev-Cpp]$ wine devcpp.exe

and make a commandline C++ project and set the include directory to C:\ImageMagick…\include\ and add these three libraries in this order:

C:/ImageMagick-6.3.7/lib/libMagick++.a
C:/ImageMagick-6.3.7/lib/libWand.a
C:/ImageMagick-6.3.7/lib/libMagick.a

Change Include DirectoryAdd Libraries

That will now compile perfectly but when it comes to linking it will complain that there is a billion functions missing. That’s because they didn’t include all the other libraries you need. Which is what this tutorial is really about. Basically I went in search of them all and now I’ve got them I’ll zip them up for everyone. The other files you need are (you can probably just paste this into your project properties):

C:/Dev-Cpp/otherlib/libfreetype.a
C:/Dev-Cpp/otherlib/libjbig.a
C:/Dev-Cpp/otherlib/libjpeg.a
C:/Dev-Cpp/otherlib/liblcms.dll.a
C:/Dev-Cpp/otherlib/libpng.a
C:/Dev-Cpp/otherlib/libtiff.a
C:/Dev-Cpp/otherlib/libtiffxx.a
C:/Dev-Cpp/otherlib/libz.a
C:/Dev-Cpp/lib/libgdi32.a

Incidentally Dev-Cpp does come with libgdi32.a, which is handy. :D

Here’s the libraries. Enjoy.

Other Libraries You Need

All my programs so far in c++ will compile to a windows .exe from linux using this method. I find it handy. Especially as windows refuses to install because linux is on my first hard disk.

Monday, August 4th, 2008