Compile failure 64-bit linux

Help
2010-12-30
2012-09-14
  • Gregory Sharp

    Gregory Sharp - 2010-12-30

    Hi,

    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
    ‘png_uint_32
    ’ for argument ‘3’ to ‘png_uint_32 png_get_IHDR(png_struct,
    png_info
    , 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).

    -Greg

     
  • Mike Gashler

    Mike Gashler - 2010-12-31

    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;

    to

    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
    release.

     
  • Gregory Sharp

    Gregory Sharp - 2010-12-31

    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.

     
  • Gregory Sharp

    Gregory Sharp - 2010-12-31

    Did you push to subversion? I still get the same error.

     
  • Mike Gashler

    Mike Gashler - 2011-01-01

    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.)

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks