I am trying to compile FreeImage on macOS Catalina, with Xcode 12.2. The
following errors occur:
Lastlogin:SunJul1113:47:54onttys000josh@Joshs-MacBook-Pro~%cd~/Desktop/Freeimagejosh@Joshs-MacBook-ProFreeimage%make/Applications/Xcode.app/Contents/Developer/usr/bin/make-fMakefile.osx/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-Os-fexceptions-fvisibility=hidden-DNO_LCMS-D__ANSI__-archx86_64-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/OpenEXR/IexMath-ISource/LibRawLite-ISource/LibRawLite/dcraw-ISource/LibRawLite/internal-ISource/LibRawLite/libraw-ISource/LibRawLite/src-ISource/LibWebP-ISource/LibJXR-ISource/LibJXR/common/include-ISource/LibJXR/image/sys-ISource/LibJXR/jxrgluelib-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk-mmacosx-version-min=10.11-cSource/ZLib/gzlib.c-oSource/ZLib/gzlib.o-x86_64Source/ZLib/gzlib.c:252:9:error:implicitdeclarationoffunction'lseek'isinvalidinC99[-Werror,-Wimplicit-function-declaration]LSEEK(state->fd,0,SEEK_END);/* so gzoffset() is correct */^Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^Source/ZLib/gzlib.c:252:9:note:didyoumean'fseek'?Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:162:6:note:'fseek'declaredhereintfseek(FILE*,long,int);^Source/ZLib/gzlib.c:258:24:error:implicitdeclarationoffunction'lseek'isinvalidinC99[-Werror,-Wimplicit-function-declaration]state->start=LSEEK(state->fd,0,SEEK_CUR);^Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^Source/ZLib/gzlib.c:359:9:error:implicitdeclarationoffunction'lseek'isinvalidinC99[-Werror,-Wimplicit-function-declaration]if(LSEEK(state->fd,state->start,SEEK_SET)==-1)^Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^Source/ZLib/gzlib.c:400:15:error:implicitdeclarationoffunction'lseek'isinvalidinC99[-Werror,-Wimplicit-function-declaration]ret=LSEEK(state->fd,offset-state->x.have,SEEK_CUR);^Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^Source/ZLib/gzlib.c:496:14:error:implicitdeclarationoffunction'lseek'isinvalidinC99[-Werror,-Wimplicit-function-declaration]offset=LSEEK(state->fd,0,SEEK_CUR);^Source/ZLib/gzlib.c:14:17:note:expandedfrommacro'LSEEK'#defineLSEEKlseek^5errorsgenerated.make[1]:***[Source/ZLib/gzlib.o-x86_64]Error1make:***[default]Error2josh@Joshs-MacBook-ProFreeimage%
I am trying to compile FreeImage on macOS Catalina, with Xcode 12.2. The
following errors occur:
Last edit: josh 2021-07-11
These are the changes I made to make it compile successfully:
Add at top of segdec.c:
Add at top of gzguts.h:
Add at line 18 of gzlib.c:
Add at top of both copies of JXRGlueJxr.c:
Last edit: josh 2021-07-11