[fixed]Irrlicht x64: libpng does not properly compile

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

[fixed]Irrlicht x64: libpng does not properly compile

Post by linkoraclehero »

It appears that it is impossible to compile Irrlicht in x64 mode on GCC.
It spawns the following linker errors:

obj\IrrReleasegcc64\libpng\png.o:png.c:(.text+0xbc7): undefined reference to `png_mmx_support'
obj\IrrReleasegcc64\libpng\pngpread.o:pngpread.c:(.text+0x7fd): undefined reference to `png_read_filter_row'
obj\IrrReleasegcc64\libpng\pngpread.o:pngpread.c:(.text+0x8cf): undefined reference to `png_do_read_interlace'
obj\IrrReleasegcc64\libpng\pngpread.o:pngpread.c:(.text+0x2064): undefined reference to `png_combine_row'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x107d): undefined reference to `png_combine_row'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x10a5): undefined reference to `png_combine_row'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x113d): undefined reference to `png_combine_row'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x11a6): undefined reference to `png_read_filter_row'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x11f1): undefined reference to `png_do_read_interlace'
obj\IrrReleasegcc64\libpng\pngread.o:pngread.c:(.text+0x1279): undefined reference to `png_combine_row'

I've looked into it, and there really isn't a reason for it. It just doesn't want to work. Oh well.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

Nevermind, found a solution. Just have to force it to add these functions by editing the if statements like so:

BEFORE:
#if !defined(PNG_USE_PNGGCCRD) && \
!(defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD))

AFTER:
#if (!defined(PNG_USE_PNGGCCRD) && \
!(defined(PNG_MMX_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD))) || defined(WIN64)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I added -DPNG_NO_MMX_CODE to the Makefile in order to make the library compiler properly. Works without touching the lib code. However, I also changed some types which were int before, and are now long (it's in SVN trunk, so using that version should be safe). Don't know how the libpng people handle it usually, maybe the configure script would take care for this stuff.
Post Reply