OpenKinect / libfreenect

Drivers and libraries for the Xbox Kinect device on Windows, Linux, and OS X
http://openkinect.org
3.57k stars 1.15k forks source link

make failing on MacOS 10.15 beta 3 (Catalina) #591

Open virusys opened 5 years ago

virusys commented 5 years ago

I recently upgraded to a new machine (2018 Mac Mini) running the 10.15 beta for another project I'm working on. Running make generates this result:

$ make
[  1%] Building C object src/CMakeFiles/freenectstatic.dir/core.c.o
/Users/billjobs/code/libfreenect/src/core.c:27:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/freenectstatic.dir/core.c.o] Error 1
make[1]: *** [src/CMakeFiles/freenectstatic.dir/all] Error 2
make: *** [all] Error 2

Apparently Apple has restructured the include directories to be all self contained within the Xcode.app package, I have tried to point make to the Xcode toolchain's header files with this command but got the same result:

$ make -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
[  1%] Building C object src/CMakeFiles/freenectstatic.dir/core.c.o
/Users/billjobs/code/libfreenect/src/core.c:27:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/freenectstatic.dir/core.c.o] Error 1
make[1]: *** [src/CMakeFiles/freenectstatic.dir/all] Error 2
make: *** [all] Error 2

I'm not sure if this is necessarily a bug or just me not fully understanding the intricacies of building command line software, but if someone could help point me in the right direction I would greatly appreciate it!

piedar commented 5 years ago

I think the custom path should apply during cmake instead. You could try

cmake .. -DCMAKE_C_FLAGS="-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
make
virusys commented 5 years ago

Thanks for that suggestion — after entering those commands I get this result:

$ make
[  1%] Building C object src/CMakeFiles/freenectstatic.dir/core.c.o
In file included from /Users/billjobs/code/libfreenect/src/core.c:27:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
#include_next <stdio.h>
              ^~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/freenectstatic.dir/core.c.o] Error 1
make[1]: *** [src/CMakeFiles/freenectstatic.dir/all] Error 2
make: *** [all] Error 2

I guess the headers in Xcode's toolchain are the LLVM specific ones, and the #include_next <stdio.h> is still looking for the standard file (and can't find it). Weird!

matheusft commented 1 year ago

I'm getting this

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [wrappers/python/python3/freenect.so] Error 1
make[1]: *** [wrappers/python/CMakeFiles/cython3_freenect.dir/all] Error 2
make: *** [all] Error 2