Page 1 of 1

[fixed]static lib problem

Posted: Mon Jan 06, 2014 10:17 am
by AReichl
This is not REALLY important, but i would like to mention, that irrlicht does not compile as a static lib any more (Visual Studio; i have not checked with gcc yet). The problem is with the newer libpng. There are new functions in pngwrite.c, which won't compile.

Re: static lib problem

Posted: Mon Jan 06, 2014 11:17 am
by CuteAlien
Which VS compiler and which Irrlicht version? I tried svn trunk with VS 2010 and that still works (32 bit and 64bit).

Re: static lib problem

Posted: Mon Jan 06, 2014 2:48 pm
by AReichl
Latest trunk ( of course ! ) and Visual Studio 2010.

I just created a fresh trunk directory and just opened the VS2010 solution without any changes, but still have the same problem:

libpng\pngwrite.c(1572): error C2440: 'function' : cannot convert from 'void (__fastcall *)(png_structp,png_const_charp)' to 'png_error_ptr'
1>libpng\pngwrite.c(1572): warning C4024: 'png_create_write_struct' : different types for formal and actual parameter 3

Re: static lib problem

Posted: Mon Jan 06, 2014 3:07 pm
by CuteAlien
Can't reproduce... even when compiling just the file.
If you go over the variable PNG_LIBPNG_VER_STRING in that line in VS - what's the value it shows you? Here: PNG_LIBPNG_VER_STRING "1.6.2"

Re: static lib problem

Posted: Mon Jan 06, 2014 3:17 pm
by AReichl
same version here.

Only difference i could think of is:
- VS2010 OR VSExpress2010
- with or without Service Pack 1
(of course there SHOULD be no difference, but who knows, hehe).

Re: static lib problem

Posted: Mon Jan 06, 2014 3:49 pm
by CuteAlien
Professional with SP1 and on Windows 7, but I found out what you do. You compile with Fast CPU which I never used. And so the problem seems to be that __fastcall is used in one place (and probably __cdecl in the other).

So in this situation in pngconf.h we should probably have
# define PNGCAPI __fastcall
instead of
# define PNGCAPI __cdecl

Modifying library headers is certainly ugly... (must remember on next update)... maybe someone has a better idea? Also not sure right now if we already can figure out if this compile-setting is used...

Re: static lib problem

Posted: Mon Jan 06, 2014 4:10 pm
by AReichl
ahumpf - yes - i always use(d) "fast FPU".
Ok - the "normal" static libraries (Debug,Release) work and i will use them.

Re: static lib problem

Posted: Mon Jan 06, 2014 4:22 pm
by CuteAlien
I changed the project file now - Irrlicht should at least compile with the settings it has :-)