Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


Compile failure 64-bit linux

  • Gregory Sharp
    Gregory Sharp


    umask 0;g++ -Wall -g -D_DEBUG -c GImage.cpp -o ../../obj/GClasses/dbg/GImage.o

    GImage.cpp: In function ‘void GClasses::LoadPng(GClasses::GImage, const
    unsigned char
    , size_t)’:

    GImage.cpp:1301:108: error: cannot convert ‘long unsigned int’ to
    ’ for argument ‘3’ to ‘png_uint_32 png_get_IHDR(png_struct,
    , png_uint_32, png_uint_32, int, int, int, int, int*)’

    I guess because sizeof(long unsigned int) is 8 bytes, the compiler doesn't
    want to convert the pointer to png_uint_32* (which is presumably 4 byte).


  • Mike Gashler
    Mike Gashler

    Thanks for pointing this out. It does not seem to repro on my 64-bit Ubuntu
    machine. What flavor of Linux are you using? What version of g++? The error
    message seems to indicate that the correct fix is to change line 1301 of
    GImage.cpp from

    unsigned long width, height;


    png_uint_32 width, height;

    On my machine, this change seems to make no difference, but I'm pretty sure it
    is the correct fix, so I will make this change and include it in the next

  • Gregory Sharp
    Gregory Sharp

    Thanks for the fix! Sorry, I forgot to mention this is gcc 4.5. OpenSUSE now
    ships with 4.5, though I think most other distros are still on 4.4.

    There may be other similar problems -- I will download and test your fix and
    report back.

  • Mike Gashler
    Mike Gashler

    Oh sorry, I pushed the change now. (BTW, if you would like commit access, just
    send me a user name via email. My address is on the main web page.)



Cancel   Add attachments