I hope #include <memory> is added to cmMachO.h. ‘string’ of libc++ includes ‘memory’. But ‘string’ of libstdc++ does not. As a result, though clang can compile cmMachO.cxx, gcc can not. Consider please.
cmMachO.h needs anything from the
memory header. All it needs is
std::string, for which
string is the correct C++ header to include. The
cmMachO.cxx file includes
cm/memory, which does include
memory. It sounds to me like you might be using a misconfigured compiler, possibly mixing headers from multiple compilers.
Thank you for reply. When version became 3.16, Internal, which is a member of cmMachO and defined in the last line of cmMachO.h, changed to a smart pointer. <memory> is required before this line. cmMachO.h is included at the top of cmMachO.cxx. So, #include <cm/memory> after #include <cmMachO.h> is late. Is this interpretation wrong?
Ah, yes you are correct. I missed the
std::unique_ptr. That looks like a bug, I’ll see if I can put a fix together for it.
Thank you very much!
Please try the branch in merge request 6835.