Updating from 1_71_0 to 1_85_0: "No member named 'memcpy' in namespace 'std::__1'"
Dear Boost gurus, Building on MacOS 12.7.3, Xcode 13.4.1, C++ dialect = C++17. Deployment target is 10.15. This particular project is x86_64 architecture. I’m only linking libboost_filesystem.a and libboost_iostreams.a (I show my build boost build steps at the end). When updating from Boost 1_71_0 to 1_85_0, I’m suddenly encountering these kinds of errors: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: No member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? /Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/system/detail/append_int.hpp:23:5: No member named 'snprintf' in namespace 'boost::system::detail'; did you mean simply 'snprintf'? In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.cp:22: In file included from ../ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.h:61: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:522: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/algorithm:653: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/functional:500: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/function.h:20: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__memory/shared_ptr.h:25: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__memory/unique_ptr.h:15: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: error: no member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? _VSTD::memcpy(&__r, __p, sizeof(__r)); ^~~~~~~ In file included from <built-in>:1: In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Screenwriter_Prefix.pch:505: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/MacTypes.h:44: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/stdbool.h:22: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__config:858:15: note: expanded from macro '_VSTD' #define _VSTD std::_LIBCPP_ABI_NAMESPACE ^ In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.cp:22: In file included from ../ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.h:61: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:522: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/algorithm:652: /Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/compatibility/cpp_c_headers/cstring:22:11: note: 'memcpy' declared here using ::memcpy; ^ …this is for all sorts of symbols. ALSO: Showing All Errors Only /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:2635:5: Use of undeclared identifier '_LIBCPP_UNREACHABLE' When including: #include <fstream> The libraries were build using: ./bootstrap.sh cxxflags="-arch x86_64 -arch arm64" cflags="-arch x86_64 -arch arm64" linkflags="-arch x86_64 -arch arm64" ./b2 toolset=clang-darwin target-os=darwin architecture=arm abi=aapcs cxxflags="-arch arm64" cflags="-arch arm64" linkflags="-arch arm64" -a mkdir -p arm64 && cp stage/lib/*.* arm64 ./b2 toolset=clang-darwin target-os=darwin architecture=x86 cxxflags="-arch x86_64" cflags="-arch x86_64" linkflags="-arch x86_64" abi=sysv binary-format=mach-o -a mkdir x86_64 && cp stage/lib/*.* x86_64 The intention was for me to eventually make UNIVERSAL dylibs using lipo – but for now, I just want to get my build back to functioning with Boost 1_85_0. NOTE that I’m continuing to use Boost’s Filesystem – even though I THINK Xcode’s C++20 might now support std::filesystem. I’ve searched all over for the answer – even consulted ChatGPT – but haven’t found a solution. But this seems like something bone-headed I’ve missed. Stephen
When updating from Boost 1_71_0 to 1_85_0, I’m suddenly encountering these kinds of errors: This looks like something else was updated too as most errors look like compiler/std-library issues: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: No member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? This is an error originating from libc++ installed on the system not even Boost. If they don't provide it in their own namespace I don't see much that Boost can do, if anything at all. /Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/system/detail/append_int.hpp:23:5: No member named 'snprintf' in namespace 'boost::system::detail'; did you mean simply 'snprintf'? That looks related. https://github.com/boostorg/system/blob/boost-1.85.0/include/boost/system/de... has a `using std::snprintf;` to pull in snprintf to boost::system::detail If that doesn't exist in std then I even wonder how the header compiles in the first place. In this case there is a change in Boost 1.85 though replacing a custom snprintf by a using. However `std::snprintf` is only available since C++11. Are you not compiling with that or higher? /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: error: no member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? Same as first. Showing All Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:2635:5: Use of undeclared identifier '_LIBCPP_UNREACHABLE' Similarly a strong hint the installed libc++ might be broken
So first make sure the C++ standard of your compilation is >= C++11.
This usually happens because you're compiling with one standard library (e.g. libc++, the default on clang) while your boost libraries were compiled with another (e.g. libstdc++, the default on gcc). R On Thu, 11 Jul 2024 at 02:21, Stephen Greenfield via Boost < boost@lists.boost.org> wrote:
Dear Boost gurus,
Building on MacOS 12.7.3, Xcode 13.4.1, C++ dialect = C++17. Deployment target is 10.15. This particular project is x86_64 architecture. I’m only linking libboost_filesystem.a and libboost_iostreams.a (I show my build boost build steps at the end).
When updating from Boost 1_71_0 to 1_85_0, I’m suddenly encountering these kinds of errors:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: No member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'?
/Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/system/detail/append_int.hpp:23:5: No member named 'snprintf' in namespace 'boost::system::detail'; did you mean simply 'snprintf'?
In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.cp:22:
In file included from ../ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.h:61:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:522:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/algorithm:653:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/functional:500:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/function.h:20:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__memory/shared_ptr.h:25:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__memory/unique_ptr.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/hash.h:40:5: error: no member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'?
_VSTD::memcpy(&__r, __p, sizeof(__r));
^~~~~~~
In file included from <built-in>:1:
In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Screenwriter_Prefix.pch:505:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/MacTypes.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/stdbool.h:22:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__config:858:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_ABI_NAMESPACE
^
In file included from /Users/stephen/dev/Screenwriter/ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.cp:22:
In file included from ../ScreenWriterX/ScreenWriterX/Screenwriter Sources/Text Engine/CThingEdit.h:61:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:522:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/algorithm:652:
/Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/compatibility/cpp_c_headers/cstring:22:11: note: 'memcpy' declared here
using ::memcpy;
^ …this is for all sorts of symbols. ALSO:
Showing All Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:2635:5: Use of undeclared identifier '_LIBCPP_UNREACHABLE'
When including:
#include <fstream>
The libraries were build using:
./bootstrap.sh cxxflags="-arch x86_64 -arch arm64" cflags="-arch x86_64 -arch arm64" linkflags="-arch x86_64 -arch arm64"
./b2 toolset=clang-darwin target-os=darwin architecture=arm abi=aapcs cxxflags="-arch arm64" cflags="-arch arm64" linkflags="-arch arm64" -a
mkdir -p arm64 && cp stage/lib/*.* arm64
./b2 toolset=clang-darwin target-os=darwin architecture=x86 cxxflags="-arch x86_64" cflags="-arch x86_64" linkflags="-arch x86_64" abi=sysv binary-format=mach-o -a
mkdir x86_64 && cp stage/lib/*.* x86_64
The intention was for me to eventually make UNIVERSAL dylibs using lipo – but for now, I just want to get my build back to functioning with Boost 1_85_0.
NOTE that I’m continuing to use Boost’s Filesystem – even though I THINK Xcode’s C++20 might now support std::filesystem.
I’ve searched all over for the answer – even consulted ChatGPT – but haven’t found a solution. But this seems like something bone-headed I’ve missed.
Stephen
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Stephen Greenfield wrote:
/Users/stephen/dev/Boost Libraries/boost_1_85_0/boost/compatibility/cpp_c_headers/cstring:22:11: note: 'memcpy' declared here
using ::memcpy; ^
Remove boost_1_85_0/boost/compatibility/cpp_c_headers from your include path. boost/compatibility is obsolete and we probably need to remove it from our releases.
participants (4)
-
Alexander Grund
-
Peter Dimov
-
Richard Hodges
-
Stephen Greenfield