hoene / libmysofa

Reader for AES SOFA files to get better HRTFs
Other
131 stars 70 forks source link

libmysofa fails to build with macOS 13.4/Xcode 14.3 #200

Closed xanadu6291 closed 1 year ago

xanadu6291 commented 1 year ago

[Here's git pull result]

$ git pull
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 21 (delta 13), reused 9 (delta 7), pack-reused 0
Unpacking objects: 100% (21/21), 8.02 KiB | 182.00 KiB/s, done.
From https://github.com/hoene/libmysofa
   bed445b..3fe5ea1  main              -> origin/main
 * [new branch]      bug/129-bigendian -> origin/bug/129-bigendian
Updating bed445b..3fe5ea1
Fast-forward
 README.md         |  6 +++++-
 src/hrtf/reader.c | 14 ++++++++++----
 2 files changed, 15 insertions(+), 5 deletions(-)

[Compile]

$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DBUILD_SHARED_LIBS:bool=off -DBUILD_TESTS=no ..
$ make
[  4%] Building C object src/CMakeFiles/mysofa-static.dir/hrtf/reader.c.o
/Volumes/ffmpeg_compile/compile/libmysofa/src/hrtf/reader.c:178:11: error: call to undeclared function 'le64toh'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    u.i = le64toh(*p2++);
          ^
1 error generated.
make[2]: *** [src/CMakeFiles/mysofa-static.dir/hrtf/reader.c.o] Error 1
make[1]: *** [src/CMakeFiles/mysofa-static.dir/all] Error 2
make: *** [all] Error 2

[My Environment] macOS 13.4 / Xcode 14.3 / Apple clang version 14.0.3 (clang-1403.0.22.14.1)

[Comment] reader.c is newly edited file. Error happens with exact file. I think it should be fixed!!

hoene commented 1 year ago

Please check branch bug/129-bigendian

xanadu6291 commented 1 year ago

I cloned current git head, and then I confirmed that the error occur. Next, based on your suggestion, I downloaded "portable_endian.h" and edit the file "reader.c" to include "portable_endian.h". This time, make was succeeded. So my issue might be solved.