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

V1.7.8 build failed: error: no member named 'piecewise_construct' #999

Open
tktkku opened this issue Jan 16, 2025 · 3 comments
Open

V1.7.8 build failed: error: no member named 'piecewise_construct' #999

tktkku opened this issue Jan 16, 2025 · 3 comments

Comments

@tktkku
Copy link

tktkku commented Jan 16, 2025

I've tried with these lines:

% gcc --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

% clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

%  ./bootstrap.sh
% ./b2 # failed
% ./b2 --clear
% ./bootstrap.sh --with-toolset=gcc
% ./b2 # failed

The error:

In file included from libs/locale/src/shared/message.cpp:27:
In file included from ./boost/unordered_map.hpp:17:
In file included from ./boost/unordered/unordered_map.hpp:21:
In file included from ./boost/unordered/detail/map.hpp:6:
In file included from ./boost/unordered/detail/implementation.hpp:44:
./boost/unordered/detail/fwd.hpp:53:16: error: no member named 'piecewise_construct' in namespace 'std'; did you mean 'piecewise_construct_t'?
   53 |     using std::piecewise_construct;
      |           ~~~~~^~~~~~~~~~~~~~~~~~~
      |                piecewise_construct_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/piecewise_construct.h:20:29: note: 'piecewise_construct_t' declared here
   20 | struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t {
      |  

Any suggestions?
Thanks.

@mclow
Copy link
Contributor

mclow commented Jan 16, 2025

Are you trying to build a library that doesn't support c++03?
Boost.Locale

I just tried the following:

~ % clang++ --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
~ % cat junk.cpp
#include <utility>

using std::piecewise_construct;
int main () {}
~ %
~ % clang++ junk.cpp -std=c++11
~ %
~ % clang++ junk.cpp          
junk.cpp:3:12: error: no member named 'piecewise_construct' in namespace 'std'; did you mean 'piecewise_construct_t'?
    3 | using std::piecewise_construct;
      |       ~~~~~^~~~~~~~~~~~~~~~~~~
      |            piecewise_construct_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/piecewise_construct.h:20:29: note: 'piecewise_construct_t' declared here
   20 | struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t {
      |                             ^
1 error generated.

@tktkku
Copy link
Author

tktkku commented Jan 17, 2025

I just tried these:

# 1
./bootstrap.sh
./b2 cxxflags="-std=c++03" # failed
# but if I run again with these
./b2 cxxflags="-std=c++11" # success

# 2
./bootstrap.sh
./b2 cxxflags="-std=c++11" # failed
# but if I run again with these
./b2 cxxflags="-std=c++03" # success

# 3
./bootstrap.sh
./b2  # failed
# but if I run again with these
./b2 cxxflags="-std=c++11" # success

Is this a bug of the b2?

But for version 1.7.5, I can compile successfully and don't need to set any flags.

Are you trying to build a library that doesn't support c++03? Boost.Locale

I just tried the following:

~ % clang++ --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
~ % cat junk.cpp
#include <utility>

using std::piecewise_construct;
int main () {}
~ %
~ % clang++ junk.cpp -std=c++11
~ %
~ % clang++ junk.cpp          
junk.cpp:3:12: error: no member named 'piecewise_construct' in namespace 'std'; did you mean 'piecewise_construct_t'?
    3 | using std::piecewise_construct;
      |       ~~~~~^~~~~~~~~~~~~~~~~~~
      |            piecewise_construct_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__utility/piecewise_construct.h:20:29: note: 'piecewise_construct_t' declared here
   20 | struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t {
      |                             ^
1 error generated.

@mclow
Copy link
Contributor

mclow commented Jan 18, 2025

I use ./b2 toolset=clang/cxxstd=11

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

2 participants