错误:“在全局名称空间中没有名为'uint8_t'的成员"在MacOS上 [英] Error: "no member named 'uint8_t' in the global namespace" on MacOS

查看:519
本文介绍了错误:“在全局名称空间中没有名为'uint8_t'的成员"在MacOS上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Chriss-MacBook-Pro-2:build louisduplessis$ cmake .. && make
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/utility:203:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:158:8: error: no
      member named 'uint8_t' in the global namespace
using::uint8_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:159:8: error: no
      member named 'uint16_t' in the global namespace
using::uint16_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:160:8: error: no
      member named 'uint32_t' in the global namespace
using::uint32_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:161:8: error: no
      member named 'uint64_t' in the global namespace
using::uint64_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:178:8: error: no
      member named 'uint_fast8_t' in the global namespace
using::uint_fast8_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:179:8: error: no
      member named 'uint_fast16_t' in the global namespace
using::uint_fast16_t;
     ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdint:180:8: error: no
      member named 'uint_fast32_t' in the global namespace
using::uint_fast32_t;
     ~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/path_planning.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/path_planning.dir/all] Error 2
make: *** [all] Error 2

如何解决这些致命错误? 我使用brew安装了cmake,并且在升级到新Mac时开始出现这些错误.

How do I fix these fatal errors? I installed cmake using brew, and these errors started appearing when I upgraded to a new Mac.

这与cmake本身的首选项有关吗?

Does this have something to do with the preferences in cmake itself?

推荐答案

我在 npm install hummus 中遇到了相同的错误,或者在尝试 clang ++ test.cpp 时遇到了相同的错误,/p>

I see the same error in npm install hummus or when I try clang++ test.cpp for

      #include <cstdint>

      int main(int argc, char **argv) {
         return 0;
      } 

要进行编译,请将Mac SDK添加到包含路径:

To compile, add the Mac SDK to the include paths:

clang ++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk test.cpp

这篇关于错误:“在全局名称空间中没有名为'uint8_t'的成员"在MacOS上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆