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] Build is broken on < 10.15: vector_fwd.hpp: error: "unknown standard library" etc. #130

Open
barracuda156 opened this issue Mar 2, 2024 · 2 comments

Comments

@barracuda156
Copy link

In file included from In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/base64.hpp/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/format.hpp::97:
In file included from :
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/charconv.hpp:50:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/std_fwd.hpp:6:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp:29:2: error: "unknown standard library"
#error "unknown standard library"
 ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/charconv.hpp:50:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/std_fwd.hpp:6:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp:29:2: error: "unknown standard library"
#error "unknown standard library"
 ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp:38:/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp34:38:34: warning::  warningvariable templates are a C++14 extension [-Wc++14-extensions]
: variable templates are a C++14 extension [-Wc++14-extensions]
template<class Alloc> c4::substr to_substr(std::vector<char, Alloc> &vec);template<class Alloc> c4::substr to_substr(std::vector<char, Alloc> &vec);
                                 ^

                                 ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp:38:34: error: redefinition of 'to_substr' as different kind of symbol
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/substr.hpp:2124:15: note: previous definition is here:38
:34: error: redefinition of 'to_substr' as different kind of symbol
inline substr to_substr(char *s)
              ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/substr.hpp:2124:15: note: previous definition is here
inline substr to_substr(char *s)
              ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/base64.cpp:1:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/base64.hpp:9In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/format.cpp:1:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/format.hpp:7:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/charconv.hpp:50:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/std_fwd.hpp:6:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_c4core/c4core/work/c4core-0.1.11-src/src/c4/std/vector_fwd.hpp:38:49: error: no member named 'vector' in namespace 'std'
template<class Alloc> c4::substr to_substr(std::vector<char, Alloc> &vec);
                                           ~~~~~^
. . .

Examples of full logs:
https://build.macports.org/builders/ports-10.14_x86_64-builder/builds/198418/steps/install-port/logs/stdio
https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/167564/steps/install-port/logs/stdio
https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/180210/steps/install-port/logs/stdio

@ryandesign
Copy link

#error "unknown standard library"

It looks like this happens when _LIBCPP_ABI_NAMESPACE is not defined:

#elif defined(_LIBCPP_ABI_NAMESPACE)
namespace std {
inline namespace _LIBCPP_ABI_NAMESPACE {
template<typename> class allocator;
template<typename T, typename Alloc> class vector;
} // namespace _LIBCPP_ABI_NAMESPACE
} // namespace std
#else
#error "unknown standard library"

It looks like _LIBCPP_ABI_NAMESPACE was introducd in llvm/llvm-project@fe13c13 which first appeared in llvm.org clang 8 a.k.a. Apple clang 11.

@biojppm
Copy link
Owner

biojppm commented Apr 19, 2024

@ryandesign thanks for the input. I have no practical way to figure out what should go in the alternative branch. If you have the opportunity and are inclined, a PR with the proper fwd declaration would be very welcome.

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

3 participants