Antigrain (AGG) under MinGW 11 May, 2005
Finally, I got it to work. It’s been entirely too long since I tried to compile /other/ people’s programs under a Windows environment. I’m not saying this is the right way to do it, but I wasn’t interested in doing it the right way, I just wanted it to work.
- Use UnxUtils to get a workable shell (
zsh
, better than nothing) and install toD:/bin
- Grab Dev-C++ to get MinGW (yeah, I know you can get it separately) and install to
D:/Home/Dev-Cpp
- Grab the Antigrain sources and extract to
D:/Home/agg23
- Grab some Win32 NetPBM binaries and extract to wherever you want (I used
D:/netpbm4/bin
)
- Start up your shell. This probably means doing a Start→Run:
d:\bin\sh.exe
. - Add the necessary paths to your shell. This probably means
export PATH="D:/Home/Dev-Cpp/bin;d:/bin;d:/netpbm4/bin;$PATH"
- Rename one of the makefiles, namely
Makefile.in.MINGW32_NT-5.0
toMakefile.in.WindowsNT
. Don’t ask. Runmake
. If all goes well, you have no errors. You can hope :) - Copy
agg23/src/libagg.a
toDev-Cpp/lib/
and copy everything fromagg23/include
toDev-Cpp/include/
because we’re lazy. - Now we’re going to try building a sample. This was the hardest part for me, because I couldn’t find the right switches at first, and had to take a second crack at it. I picked
agg23/tutorial/t03_spectrum
socd
there. - Run
g++ -o test t03_spectrum.cpp -lstdc++
, which shouldn’t get chatty. If it gives the error below, you then it can’t find libstdc++ which is what I fought for the longest time.
Figure 1: Bad output when you forget to link with libstdc++
Machine# g++ -o test t01_rendering_buffer.cpp
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text+0x1de):t01_rendering_buffer.cpp: undefined reference to `__gxx_personality_sj0'
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text+0x21e):t01_rendering_buffer.cpp: undefined reference to `operator new[](unsigned int)'
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text+0x317):t01_rendering_buffer.cpp: undefined reference to `operator delete[](void*)'
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text$_ZN3agg13row_ptr_cacheIhED1Ev[agg::row_ptr_cache<unsigned char>::~row_ptr_cache()]+0x19):t01_rendering_buffer.cpp: undefined reference to `operator delete[](void*)'
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text$_ZN3agg13row_ptr_cacheIhE6attachEPhjji[agg::row_ptr_cache<unsigned char>::attach(unsigned char*, unsigned int, unsigned int, int)]+0x48):t01_rendering_buffer.cpp: undefined reference to `operator delete[](void*)'
d:\DOCUME~1\HatchT\LOCALS~1\Temp/ccqQbaaa.o(.text$_ZN3agg13row_ptr_cacheIhE6attachEPhjji[agg::row_ptr_cache<unsigned char>::attach(unsigned char*, unsigned int, unsigned int, int)]+0x5f):t01_rendering_buffer.cpp: undefined reference to `operator new[](unsigned int)'
collect2: ld returned 1 exit status
Here’s the lovely test image produced by t03
to prove that it actually does work on my system.
Disclaimer: this seems to be ignoring the src/platform
subdirectory along with src/ctrl
so the examples don't want to build, but the tutorials work okay, and it may work for what I need (antialiased roundrect rendering to a ppm).