yaml-cpp
yaml-cpp copied to clipboard
Linking fails on Centos7
Hi,
I report a linking error on Centos 7 with yaml-cpp from the conda-forge repository.
Step to reproduce:
Run a docker container from conda/miniconda3-centos7
docker run -i -t conda/miniconda3-centos7 /bin/bash
Install g++ 10 suite, yaml-cpp from conda-forge, build a test program
conda install -c conda-forge yaml-cpp
yum update -y
yum install -y centos-release-scl-rh
yum install -y devtoolset-10
export PATH=/opt/rh/devtoolset-10/root/bin:$PATH
# or scl enable devtoolset-10 bash
g++ -o test -I/usr/local/include -L/usr/local/lib test.cpp -lyaml-cpp
that gives:
/opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: /tmp/cc22r2Wj.o: in function `YAML::operator<<(YAML::Emitter&, char const*)':
test.cpp:(.text._ZN4YAMLlsERNS_7EmitterEPKc[_ZN4YAMLlsERNS_7EmitterEPKc]+0x43):undefined reference to `YAML::Emitter::Write(std::string const&)'
collect2: error: ld returned 1 exit status
The test program is:
#include <yaml-cpp/yaml.h>
#include <iostream>
int main (void){
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}