#35 Patch for MinGW Compilation (maybe others)

closed
nobody
None
5
2008-09-12
2007-05-09
No

A function needed a prototype on il_jpeg and some variables changed name but the change was not made on il_tiff, also ILU was being linked without the -no-undefined flag, which is essential for compiling DLLs on MinGW.

Sorry for the large file, apparently il_jpeg was not on UNIX text format.

Discussion

  • Rodrigo Hernandez

    MinGW DevIL compilation Patch

     
  • Nicolas Weber

    Nicolas Weber - 2007-12-04
    • status: open --> pending
     
  • Nicolas Weber

    Nicolas Weber - 2007-12-04

    Logged In: YES
    user_id=858439
    Originator: NO

    Is this still up to date? I believe I checked in something with -no-undefined a few weeks ago. If so, please resend this without whitespace changes. Thanks :-)

     
  • Rodrigo Hernandez

    • status: pending --> open
     
  • Rodrigo Hernandez

    Logged In: YES
    user_id=366248
    Originator: YES

    No, you can close this one, my most recent patch (the one you mentioned) supersedes this one. Thanks for looking it up though :)

    By the way, you should change function declarations that use (ILvoid) as parameter, the upcoming MinGW gcc-sjlj 4.1.2 compiler considers that an error, the 2 functions I found were:

    ILAPI ILboolean ILAPIENTRY ilClearImage(ILvoid);
    ILAPI ILuint ILAPIENTRY ilCloneCurImage(ILvoid);

    should be changed to

    ILAPI ILboolean ILAPIENTRY ilClearImage();
    ILAPI ILuint ILAPIENTRY ilCloneCurImage();

    probably on the definition as well, I would make a patch, but is a rather trivial change.

     
  • Nobody/Anonymous

    Logged In: NO

    At least in ancient C, f(void) was a function that doesn't take any parameters and f() was a function that can take a variable number of arguments (like f() and f(...) in C++). Since DevIL is C, I thought this should stay as is...? Doesn't this change break lots of programs?

     
  • Rodrigo Hernandez

    Logged In: YES
    user_id=366248
    Originator: YES

    I don't think this would break any programs, its not like you're changing the function calling convention or changing the API, I was going to suggest encapsulating the headers into #ifdef __cplusplus macros, but they already are.

    Here is some more detailed info, the GCC version is gcc-sjlj 4.2.1-2 and the errors I get when compiling my app (I tried rebuilding the libs from SVN, but there seems to be yet another issue with configure finding image libraries already on the system, but thats another patch :) )

    In file included from Texture.cpp:2:
    c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/IL/il.h:448: error: '<anonymous>' has incomplete type
    c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/IL/il.h:448: error: invalid use of 'ILvoid'
    c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/IL/il.h:467: error: too few arguments to function 'ILubyte* ilGetData(<type error>)'
    Texture.cpp:65: error: at this point in file
    c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/IL/il.h: In member function 'bool CTexture::LoadFromMemory(const unsigned char*, int, GLint)':
    c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/IL/il.h:467: error: too few arguments to function 'ILubyte* ilGetData(<type error>)'
    Texture.cpp:97: error: at this point in file

    On top of that, I am getting a lot of warnings about C99 not supporting inline functions and reverting to C89 when compiling from SVN.

     
  • Denton Woods

    Denton Woods - 2008-09-12
    • status: open --> closed
     

Log in to post a comment.