I'm getting this error:
$ native-image -jar foo.jar bin/java-Objects.bin
...
[bin/java-Objects.bin:24855] classlist: 1,143.29 ms, 0.96 GB
[bin/java-Objects.bin:24855] (cap): 1,803.60 ms, 0.96 GB
[bin/java-Objects.bin:24855] setup: 2,304.75 ms, 0.96 GB
Error: Error compiling query code (in /var/folders/vl/633jwjvn2jvbj9zfg1sgglhw0000gp/T/SVM-3396448792019069231/PosixDirectives.c). Compiler command '/usr/bin/cc -Wall -Werror -ObjC -o /var/folders/vl/633jwjvn2jvbj9zfg1sgglhw0000gp/T/SVM-3396448792019069231/PosixDirectives /var/folders/vl/633jwjvn2jvbj9zfg1sgglhw0000gp/T/SVM-3396448792019069231/PosixDirectives.c' output included error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/sys/resource.h:202:2:
error: unknown type name 'uint8_t'
I'm with Clang:
$ clang --version
Homebrew clang version 13.0.0
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
It seems that the problem is with this code in sys/resource.h
:
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#include <stdint.h>
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
This line with stdint.h
doesn't get included and that's why uint8_t
doesn't get defined.