Std::__cxx11::basic_string YAML error

Hello,

I am getting an error when trying to execute this line in my code:
yamlNode[option.getName()]

where option.getName() is supposed to be a string.

The error is:

#5  YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (this=0x1578670, key=..., pMemory=...) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/yaml-cpp/include/yaml-cpp/node/detail/impl.h:119
#6  0x0000000000423bb6 in get<std::__cxx11::basic_string<char> > (pMemory=..., key=..., this=<optimized out>) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/yaml-cpp/include/yaml-cpp/node/detail/node_ref.h:67
#7  get<std::__cxx11::basic_string<char> > (pMemory=..., key=..., this=0x1580de0) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/yaml-cpp/include/yaml-cpp/node/detail/node.h:130
#8  YAML::Node::operator[]<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (this=this
entry=0x7ffebd620d60, key=...) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/yaml-cpp/include/yaml-cpp/node/impl.h:390
#9  0x00000000004176a5 in CmdLineParser::dumpConfigAsYamlNode (this=this
entry=0x7ffebd620f00) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/gundam/submodules/simple-cpp-cmd-line-parser/include/implementation/CmdLineParser.impl.h:413
#10 0x0000000000417e37 in CmdLineParser::dumpConfigAsJsonStr[abi:cxx11]() (this=this
entry=0x7ffebd620f00) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/gundam/submodules/simple-cpp-cmd-line-parser/include/implementation/CmdLineParser.impl.h:429
#11 0x0000000000414245 in main (argc=3, argv=0x7ffebd6221f8) at /afs/cern.ch/work/c/cschloes/T2K/test_gundam/gundam/src/Applications/src/gundamFitter.cxx:43

I have made sure that both ROOT and YAML have been compiled with the same compiler and with C++11.

Appreciate any help or suggestions!
Many thanks!


ROOT Version: 6.24.06
Platform: /cvmfs/sft.cern.ch/lcg/contrib/gcc/7.3.0/x86_64-centos7/setup.sh
Compiler: 3.18.3


Maybe @Axel has an idea…

Do you still have this problem? If you do, please provide more information (the first message only contains the location of the error and not the error itself (and the code in not in ROOT itself but YAML so we do not have easy access to that code).

Fortunately, I managed to solve it. It works after updating LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$INSTALL_DIR/yaml-cpp/lib64:$LD_LIBRARY_PATH

and with YAML version yaml-cpp-0.7.0.

In addition, I set the path to the YAML install directory when running cmake on my code with:

-D YAMLCPP_INSTALL_DIR=$INSTALL_DIR/yaml-cpp

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