在Mavericks升级后运行/编译root cern代码的问题

时间:2013-10-28 13:29:59

标签: c++ xcode compiler-errors osx-mavericks root-framework

我最近将我的操作系统升级为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(输入,换行);没有std ::,同样的错误。

最后的试验是写istream :: getline(输入,行);代替。在那种情况下,我得到类似于第一个错误的东西:

 *** 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)触发

感谢您的时间。

0 个答案:

没有答案