Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 10.13 error: unknown type name 'uint8_t' #2009

Closed
lenhsherr opened this issue Nov 17, 2017 · 13 comments
Closed

macOS 10.13 error: unknown type name 'uint8_t' #2009

lenhsherr opened this issue Nov 17, 2017 · 13 comments

Comments

@lenhsherr
Copy link

lenhsherr commented Nov 17, 2017

Hi,

I encountered this error running the very basic hello world tutorial

cythoning hello.pyx to hello.cpp
building 'hello' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/haotian/anaconda3/include -arch x86_64 -I/Users/haotian/anaconda3/include -arch x86_64 -I/Users/haotian/anaconda3/include/python3.6m -c hello.cpp -o build/temp.macosx-10.7-x86_64-3.6/hello.o -stdlib=libc++
In file included from hello.cpp:4:
In file included from /Users/haotian/anaconda3/include/python3.6m/Python.h:34:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:196:2: error: unknown type name 'uint8_t'
        uint8_t  ri_uuid[16];
        ^
/usr/include/sys/resource.h:197:2: error: unknown type name 'uint64_t'
        uint64_t ri_user_time;
        ^
/usr/include/sys/resource.h:198:2: error: unknown type name 'uint64_t'
        uint64_t ri_system_time;
        ^
/usr/include/sys/resource.h:199:2: error: unknown type name 'uint64_t'
        uint64_t ri_pkg_idle_wkups;
        ^
/usr/include/sys/resource.h:200:2: error: unknown type name 'uint64_t'
        uint64_t ri_interrupt_wkups;
        ^
/usr/include/sys/resource.h:201:2: error: unknown type name 'uint64_t'
        uint64_t ri_pageins;
        ^
/usr/include/sys/resource.h:202:2: error: unknown type name 'uint64_t'
        uint64_t ri_wired_size;
        ^
/usr/include/sys/resource.h:203:2: error: unknown type name 'uint64_t'
        uint64_t ri_resident_size;
        ^
/usr/include/sys/resource.h:204:2: error: unknown type name 'uint64_t'
        uint64_t ri_phys_footprint;
        ^
/usr/include/sys/resource.h:205:2: error: unknown type name 'uint64_t'
        uint64_t ri_proc_start_abstime;
        ^
/usr/include/sys/resource.h:206:2: error: unknown type name 'uint64_t'
        uint64_t ri_proc_exit_abstime;
        ^
/usr/include/sys/resource.h:210:2: error: unknown type name 'uint8_t'
        uint8_t  ri_uuid[16];
        ^
/usr/include/sys/resource.h:211:2: error: unknown type name 'uint64_t'
        uint64_t ri_user_time;
        ^
/usr/include/sys/resource.h:212:2: error: unknown type name 'uint64_t'
        uint64_t ri_system_time;
        ^
/usr/include/sys/resource.h:213:2: error: unknown type name 'uint64_t'
        uint64_t ri_pkg_idle_wkups;
        ^
/usr/include/sys/resource.h:214:2: error: unknown type name 'uint64_t'
        uint64_t ri_interrupt_wkups;
        ^
/usr/include/sys/resource.h:215:2: error: unknown type name 'uint64_t'
        uint64_t ri_pageins;
        ^
/usr/include/sys/resource.h:216:2: error: unknown type name 'uint64_t'
        uint64_t ri_wired_size;
        ^
/usr/include/sys/resource.h:217:2: error: unknown type name 'uint64_t'
        uint64_t ri_resident_size;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'gcc' failed with exit status 1

I'm using python 3.6.3, Cython 0.27.3. Any idea why this is happening?

@robertwb
Copy link
Contributor

Please use the mailing list or stack overflow for user support.

@matkam
Copy link

matkam commented Dec 7, 2017

@lenhsherr have you found a solution? I haven't been able to figure this one out.

@lenhsherr
Copy link
Author

lenhsherr commented Dec 7, 2017 via email

@matkam
Copy link

matkam commented Dec 7, 2017

@lenhsherr I think I figured it out. When I upgraded to Mac OS 10.13, the upgrade messed up my homebrew installation, including a bunch of header files under /usr/local/include directory. I renamed this directory and don't see any more compilation errors. So I'll have to remove this directory and reinstall my brew packages.

@lenhsherr
Copy link
Author

Thank you @matkam I just tried reinstalling brew and it solved the problem.

@sljeff
Copy link

sljeff commented Jan 18, 2018

I just removed /usr/local/include and then reinstalled llvm using homebrew. Problem solved.

@riparian-imakedonsky
Copy link

Lol. It fixed another problem with python extensions compilation i struggled with for a week also.
What a wondrous collateral damage))

Thanks for solution, @matkam

@tninja
Copy link

tninja commented Mar 29, 2018

Thanks @sljeff 's solution and it works for me.

@deepakkumarnd
Copy link

@sljeff Thanks for the solution, it works

@ParanoidBeing
Copy link

I just removed /usr/local/include and then reinstalled llvm using homebrew. Problem solved.

Thank you for this.

@chuksugwuh
Copy link

I was able to find a workaround. I went to /usr/local/include and rename the include folder to anything else. Then run the brew command required, e.g. brew install --HEAD libimobiledevice or brew install --HEAD usbmuxd. It'll fail to link, so go back, rename the include folder back to include and then run brew link libimobiledevice. After that it worked and all is well. I'm available to help if you need any further clarification in fixing this error. By the way I'm running MacOS Mojave 10.14.4

@glazari
Copy link

glazari commented Apr 16, 2020

I just renamed /usr/local/include

This seemed to have worked for me as well.
but it bothers me that I don`t fully understand what the problem was. Does anyone have a good understanding?

For me this problem seemed to have started when I changed Mac to one with a newer OS and transferred the old files to the new Mac. Could it be that the new Mac uses a diffente version of gcc and the old /usr/loacl/include/ files were incompatible?

@P-rgb-max
Copy link

I just removed /usr/local/include and then reinstalled llvm using homebrew. Problem solved.

For me it not worked.
For those to who also not worked (sorry if my English is bad), be sure that you are using the gcc-<version>, and not simply gcc. Try to do a dry run, without any input files, and if you see cmake: ..., you should not use so command.

More information can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests