Tag Archives: errors

Compiling analog 6.0 on Cygwin

Again, mostly for my own use later.  I had a need to run analog on my machine, and I didn’t want to download the Windows binary, because everything else I would be doing with the log files would be via Cygwin.  After a few unsuccessful attempts at compiling analog, I finally RTFM (read the flipping makefile) and made the following two changes.   In src/Makefile,

DEFS = -DHAVE_GD

LIBS = -lm -lz -ljpeg -lgd

That tells the analog makefile to use your pre-existing GD, JPEG and ZLIB libraries, rather than compiling the ones it comes with (it was those libraries which were giving me errors).  Once I’d done that, make clean and make worked fine and analog behaves as you would expect.

For reference, the errors I was getting before this change were,

libpng/pngwrite.o:pngwrite.c:(.text+0x1ec): undefined reference to `__imp__png_libpng_ver'
libpng/pngwrite.o:pngwrite.c:(.text+0x1f8): undefined reference to `__imp__png_libpng_ver'
libpng/pngwutil.o:pngwutil.c:(.text+0x45c): undefined reference to `__imp__png_IHDR'
libpng/pngwutil.o:pngwutil.c:(.text+0x6a5): undefined reference to `__imp__png_PLTE'
libpng/pngwutil.o:pngwutil.c:(.text+0x73d): undefined reference to `__imp__png_IDAT'
libpng/pngwutil.o:pngwutil.c:(.text+0x77e): undefined reference to `__imp__png_IEND'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: libpng/pngwutil.o: bad reloc address 0x12c in section `.rdata'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
Makefile:76: recipe for target `analog' failed
make: *** [analog] Error 1