簡體   English   中英

錯誤:MacOS上的“全局名稱空間中沒有名為'uint8_t'的成員”

[英]Error: “no member named 'uint8_t' in the global namespace” on 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時開始出現這些錯誤。

這與cmake本身的首選項有關嗎?

我在npm install hummus中或在嘗試clang ++ test.cpp時看到相同的錯誤

      #include <cstdint>

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

要進行編譯,請將Mac SDK添加到包含路徑:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM