tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.81k stars 320 forks source link

"no member named 'XXX' in the global namespace" on NixOS #343

Open au-phiware opened 2 years ago

au-phiware commented 2 years ago

I am trying to run ./build.sh on NixOS (21.11). I faced many issues and I feel like I am very close but I get these errors during the final testing:

testing x86_64-apple-darwin21.1-clang++ -stdlib=libc++ -std=c++11 ... failed (ignored)

testing x86_64h-apple-darwin21.1-clang ... clang-7: warning: argument unused during compilation: '-arch x86_64h' [-Wunused-command-line-argument]
works
testing x86_64h-apple-darwin21.1-clang++ ... In file included from ./oclang/test.cpp:1:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/iostream:37:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/ios:215:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__locale:14:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string:506:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string_view:175:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__string:57:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/algorithm:642:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/utility:204:
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:152:8: error:
      no member named 'int8_t' in the global namespace; did you mean 'wint_t'?
using::int8_t;
     ~~^
/nix/store/rcjksx6hx0i1sm8q1jhz5a415sb5xcwf-glibc-2.33-123-dev/include/bits/types/wint_t.h:20:23: note:
      'wint_t' declared here
typedef __WINT_TYPE__ wint_t;
                      ^
In file included from ./oclang/test.cpp:1:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/iostream:37:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/ios:215:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__locale:14:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string:506:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string_view:175:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__string:57:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/algorithm:642:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/utility:204:
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:153:8: error:
      no member named 'int16_t' in the global namespace
using::int16_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:154:8: error:
      no member named 'int32_t' in the global namespace
using::int32_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:155:8: error:
      no member named 'int64_t' in the global namespace
using::int64_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:157:8: error:
      no member named 'uint8_t' in the global namespace; did you mean 'wint_t'?
using::uint8_t;
     ~~^
/nix/store/rcjksx6hx0i1sm8q1jhz5a415sb5xcwf-glibc-2.33-123-dev/include/bits/types/wint_t.h:20:23: note:
      'wint_t' declared here
typedef __WINT_TYPE__ wint_t;
                      ^
In file included from ./oclang/test.cpp:1:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/iostream:37:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/ios:215:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__locale:14:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string:506:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/string_view:175:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/__string:57:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/algorithm:642:
In file included from ./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/utility:204:
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:158:8: error:
      no member named 'uint16_t' in the global namespace
using::uint16_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:159:8: error:
      no member named 'uint32_t' in the global namespace
using::uint32_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:160:8: error:
      no member named 'uint64_t' in the global namespace
using::uint64_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:162:8: error:
      no member named 'int_least8_t' in the global namespace
using::int_least8_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:163:8: error:
      no member named 'int_least16_t' in the global namespace
using::int_least16_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:164:8: error:
      no member named 'int_least32_t' in the global namespace
using::int_least32_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:165:8: error:
      no member named 'int_least64_t' in the global namespace
using::int_least64_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:167:8: error:
      no member named 'uint_least8_t' in the global namespace
using::uint_least8_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:168:8: error:
      no member named 'uint_least16_t' in the global namespace
using::uint_least16_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:169:8: error:
      no member named 'uint_least32_t' in the global namespace
using::uint_least32_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:170:8: error:
      no member named 'uint_least64_t' in the global namespace
using::uint_least64_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:172:8: error:
      no member named 'int_fast8_t' in the global namespace
using::int_fast8_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:173:8: error:
      no member named 'int_fast16_t' in the global namespace
using::int_fast16_t;
     ~~^
./target/bin/../SDK/MacOSX12.0.sdk/usr/include/c++/v1/cstdint:174:8: error:
      no member named 'int_fast32_t' in the global namespace
using::int_fast32_t;
     ~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
failed (ignored)

The SDK tarball was generated with ./tools/gen_sdk_package_pbzx.sh and I've noticed that in #243 that at first the SDKs were suspected to be broken and then later that clang installation itself was broken. I've already had to 'fix' a few things to present clang in a way that osxcross expects; if you can tell me exactly what's missing in this situation I'd really appreciate it!