Unsuccessful build FreeImage library

Help
2012-12-12
2013-10-19
  • Luqman Ghani

    Luqman Ghani - 2012-12-12

    I tried to make the FreeImage library in MinGW which was downloaded from the following link:
    https://sourceforge.net/projects/freeimage/

    But the compiler would give errors which were like 'memset was not declared in this scope.' And in the code it was not declared either in ImfAutoArray.h and neither in the included file. I am not a makefile expert and cannot go through the whole code. Kindly, help me out with this issue.

    Thanks,
    Luqman Ghani

    Following is the compiler's version of complain:

    $ make -f Makefile.mingw
    g++ -O3 -fexceptions -Wno-ctor-dtor-privacy -DNDEBUG -DWINVER=0x0500 -DFREEIMAGE_EXPORTS -DOPJ_STATIC -DLIBRAW_NODLL -in
    clude stdexcept  -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibT
    IFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/Ilm
    Imf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/
    internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -c Source/OpenEXR/./IlmImf/ImfHuf.cpp -o Source/OpenEXR/./Il
    mImf/ImfHuf.o
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of 'Imf::AutoArray<T, size>::AutoArray() [with T = int; int size
    = 65537]':
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:298:34:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: 'memset' was not declared in this scope, and no declarations were fou
    nd by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/string.h:40:39: note: 'void* memset(void*, int, size_t)' decla
    red here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of 'Imf::AutoArray<T, size>::AutoArray() [with T = long long unsi
    gned int*; int size = 65537]':
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:299:38:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: 'memset' was not declared in this scope, and no declarations were fou
    nd by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/string.h:40:39: note: 'void* memset(void*, int, size_t)' decla
    red here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of 'Imf::AutoArray<T, size>::AutoArray() [with T = long long unsi
    gned int; int size = 65537]':
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:361:36:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: 'memset' was not declared in this scope, and no declarations were fou
    nd by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/string.h:40:39: note: 'void* memset(void*, int, size_t)' decla
    red here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of 'Imf::AutoArray<T, size>::AutoArray() [with T = Imf::{anonymou
    s}::HufDec; int size = 16384]':
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:1062:37:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: 'memset' was not declared in this scope, and no declarations were fou
    nd by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/string.h:40:39: note: 'void* memset(void*, int, size_t)' decla
    red here, later in the translation unit
    make: *** [Source/OpenEXR/./IlmImf/ImfHuf.o] Error 1
    
     
  • J. L. Turriff

    J. L. Turriff - 2013-03-12

    I am experiencing the same problem with memset when I compile on OpenSuSE 12.2, x86_64, with gcc-4_7-branch revision 189773. When make reaches Source/OpenEXR/./IlmImf/ImfHuf.cpp I see:

    g++ -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -fPIC -c Source/OpenEXR/./IlmImf/ImfHuf.cpp -o Source/OpenEXR/./IlmImf/ImfHuf.o
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of Imf::AutoArray<T, size>::AutoArray() [with T = int; int size = 65537]:
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:298:34:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: memset was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    /usr/include/string.h:65:14: note: void* memset(void*, int, size_t) declared here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of Imf::AutoArray<T, size>::AutoArray() [with T = long unsigned int*; int size = 65537]:
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:299:38:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: memset was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    /usr/include/string.h:65:14: note: void* memset(void*, int, size_t) declared here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of Imf::AutoArray<T, size>::AutoArray() [with T = long unsigned int; int size = 65537]:
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:361:36:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: memset was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    /usr/include/string.h:65:14: note: void* memset(void*, int, size_t) declared here, later in the translation unit
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:50:0:
    Source/OpenEXR/IlmImf/ImfAutoArray.h: In instantiation of Imf::AutoArray<T, size>::AutoArray() [with T = Imf::{anonymous}::HufDec; int size = 16384]:
    Source/OpenEXR/./IlmImf/ImfHuf.cpp:1062:37:   required from here
    Source/OpenEXR/IlmImf/ImfAutoArray.h:60:40: error: memset was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from Source/OpenEXR/./IlmImf/ImfHuf.cpp:52:0:
    /usr/include/string.h:65:14: note: void* memset(void*, int, size_t) declared here, later in the translation unit
    make[1]: *** [Source/OpenEXR/./IlmImf/ImfHuf.o] Error 1
    make[1]: Leaving directory `/usr/local/src/FreeImage'
    make: *** [default] Error 2
    

    Leslie

     
  • Hervé Drolon

    Hervé Drolon - 2013-03-13

    Hi,

    The official OpenEXR release contains little problems with compilers compatibility (essentially, ".h" header inclusions).
    These problems have been fixed in the FreeImage CVS (I hope so).
    So, try to get the FreeImage CVS version : it should work.

    Hervé

     
  • R Walker

    R Walker - 2013-10-19

    Got a similar error (slackware 14.0 gcc 4.7.1); fix was pretty simple, ImfHuf.cpp does some project specific includes before <string.h>, and gcc is pretending it doesn't know what memset is.

    rearanging the header list (I added <cstring> for no good reason I think) and it compiled.

    #include <string.h>
    #include <cstring>
    #include <algorithm>
    #include <ImfHuf.h>
    #include <ImfInt64.h>
    #include <ImfAutoArray.h>
    #include "Iex.h"
    #include <assert.h>

    *sorry for all the edits, not used to this posting system..

     
    Last edit: R Walker 2013-10-19

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks