One problem of compiling my code in macOS

___I use Cmake to compile my program in my MacBook.
The displaying is following:

Scanning dependencies of target ana_1

[ 50%] Building CXX object CMakeFiles/ana_1.dir/ana_1.cc.o

In file included from /Users/pedanter/work/CT_PBC/ana_1.cc:1:

In file included from /Users/pedanter/root_6.10.02/include/TFile.h:26:

In file included from /Users/pedanter/root_6.10.02/include/TDirectoryFile.h:24:

In file included from /Users/pedanter/root_6.10.02/include/TDirectory.h:25:

In file included from /Users/pedanter/root_6.10.02/include/TNamed.h:26:

In file included from /Users/pedanter/root_6.10.02/include/TString.h:28:

In file included from /Users/pedanter/root_6.10.02/include/RStringView.h:24:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/string_view:11:2: error:

“<experimental/string_view> has been removed. Use <string_view> instead.”

#error “<experimental/string_view> has been removed. Use <string_view> instead.”

^

In file included from /Users/pedanter/work/CT_PBC/ana_1.cc:1:

In file included from /Users/pedanter/root_6.10.02/include/TFile.h:26:

In file included from /Users/pedanter/root_6.10.02/include/TDirectoryFile.h:24:

In file included from /Users/pedanter/root_6.10.02/include/TDirectory.h:25:

In file included from /Users/pedanter/root_6.10.02/include/TNamed.h:26:

In file included from /Users/pedanter/root_6.10.02/include/TString.h:28:

/Users/pedanter/root_6.10.02/include/RStringView.h:32:37: error: no member named

‘experimental’ in namespace ‘std’

using basic_string_view = ::std::experimental::basic_string_view<_Cha…


2 errors generated.

make[2]: *** [CMakeFiles/ana_1.dir/ana_1.cc.o] Error 1

make[1]: *** [CMakeFiles/ana_1.dir/all] Error 2

make: *** [all] Error 2

MacBook-Pro-2:ana_1_build pedanter$ xcode

-bash: xcode: command not found

MacBook-Pro-2:ana_1_build pedanter$ Xcode

-bash: Xcode: command not found


_ROOT Version:_ Not Provided
_Platform:_ Not Provided
_Compiler:_ Not Provided
___

Hi @heresy_pedanter,

it looks like this is because string_view has been moved out from experimental in OS X.
I see that your root versions seems to 6.10, so I would assume (I didn’t look it up) that we fixed this renaming in the mean time. Did you try if the same problem appears with a more recent root version such as 6.16?

But the installing of root 6.16 is failed!

Ok, why does it fail?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.