问题描述
我正在尝试使用 G4GDMLParser 读取 GDML 文件:
...
G4GDMLParser parser;
parser.Read(G4Str_Filename,fValidate);
...
G4GDML: Reading materials...
G4GDML: Reading solids...
Evaluator : Syntax error
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : InvalidExpression
issued by : G4GDMLEvaluator::Evaluate()
Error in expression: 40.0
*** Fatal Exception *** core dump ***
**** Track @R_661_4045@ion is not available at this moment
**** Step @R_661_4045@ion is not available at this moment
-------- EEEE -------- G4Exception-END --------- EEEE -------
*** G4Exception: Aborting execution ***
Signal: SIGABRT (Aborted)
解决方法
我发现问题是我的语言环境 TR 使用“,”而不是“。”对于浮动,只需在代码中的某处设置语言环境;
std::setlocale(LC_ALL,"en_US.UTF-8");
std::setlocale(LC_NUMERIC,"en_US.UTF-8");