1

我最近将我的操作系统升级到了 Mavericks,重新安装了 Xcode(从 4.6.2 升级到 5.0.1),还安装了 xcode-select。最后我再次安装了root(v5.34/10),从git下载了源代码,并按照标准的./configure和make。然后源 bin/thisroot.sh。

但是在完成所有这些步骤之后,之前编译和运行的代码不再工作了。

我正在使用根库编译我的代码,为了编译我使用以下输出作为选项:

 root-config --cflags
 root-config --glibs

得到以下信息:

g++ main.C -pthread -stdlib=libc++ -m64 -I/Users/user/root.git/include -L/Users/royal/root.git/lib -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -Wl,-rpath,/Users/user/root.git/lib -stdlib=libc++ -lm -ldl

我尝试同时使用 g++ 和 clang++,但我得到了同样的错误:

*** Break *** segmentation violation
Generating stack trace...
 -- 
Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: `xcrun atos`
To silence this warning, pass the '-d' command-line flag to this tool.
 -- 
 0x0000000106cee8d7 in main (in a.out) + 1447
 -- 
Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: `xcrun atos`
To silence this warning, pass the '-d' command-line flag to this tool.
 -- 
 0x00007fff8e2e95fd in start (in libdyld.dylib) + 1
 0x0000000000000001 in <unknown function>

此外,我尝试在不通过 root main.C 编译的情况下运行代码,在这种情况下,我得到以下信息:

Error: Ambiguous overload resolution (10001,2) ReactorSpectrumMultiple.h:237:
Calling : getline(ifstream,string);
Match rank: file     line  signature
ffffffff (compiled)   0 istream& getline(istream&,string&,char);
*    10001 (compiled)   0 istream& getline(istream&,string&);
 ffffffff (compiled)   0 basic_istream<char,char_traits<char> >& getline(basic_istream<char,char_traits<char> >&,string&,char);
*    10001 (compiled)   0 basic_istream<char,char_traits<char> >& getline(basic_istream<char,char_traits<char> >&,string&);

*** Interpreter error recovered ***

更让我困惑的是,正如我之前所说的,我没有更改任何代码行,而且之前运行良好。我写下触发最后一个错误的行,以防你看到明显的东西:

 std::string line;
 std::ifstream input(IsotopeName);

 std::getline(input,line);//  This line produces the error

我也尝试使用 getline(input,line); 没有 std::,同样的错误。

最后的试验是写 istream::getline(input,line); 反而。在这种情况下,我得到类似于第一个错误的内容:

 *** Break *** segmentation violation
 Generating stack trace...
 -- 
Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: `xcrun atos`
To silence this warning, pass the '-d' command-line flag to this tool.
 -- 
 0x000000010e6401d9 in G__getfunction (in libCint.so) + 5929
 -- 
Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: `xcrun atos`
To silence this warning, pass the '-d' command-line flag to this tool.
 -- 
 0x000000010e63561b in G__getitem (in libCint.so) + 507
 -- 

我不会复制整个输出,因为它会继续打印该警告,但由不同的来源(libCint.so、libCore.so、libRint.so、root.exe 和 libdyld.dylib)触发

感谢您的时间。

4

0 回答 0