Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
native-image says "unknown type name 'uint8_t'" during compilation

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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Possible solution

Please, consider trying to follow the instruction from quarkus/faq.adoc at main · quarkusio/quarkus:

1. Native compilation

Native executable fails on macOS with error: unknown type name 'uint8_t'

Your macOS has the wrong *.h files compared to the OS and no gcc compilation will work. This can happen when you migrate from versions of the OS. See Cannot compile any C++ programs; error: unknown type name 'uint8_t'

The solution is to

  • sudo mv /usr/local/include /usr/local/include.old
  • Reinstall XCode for good measure
  • (optional?) brew install llvm
  • generally reinstall your brew dependencies with native compilation

The executable should work now.

The purpose of (the idea behind) renaming the include directory (from include to include.old) seems to be explained in the answer.

Additional references

  • Related question. May contain some possible solutions. Broken c++ std libraries on macOS High Sierra 10.13 - Stack Overflow.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!