Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation fault (core dumped) #5

Open
rcuu opened this issue Jul 23, 2020 · 0 comments
Open

segmentation fault (core dumped) #5

rcuu opened this issue Jul 23, 2020 · 0 comments

Comments

@rcuu
Copy link

rcuu commented Jul 23, 2020

I set YAML_CPP_SUPPORT_MERGE_KEYS in the merge-key-support branch to "on" and successfully compiled, but when I simply use the library, I found that the program reported a segmentation-fault error.

Here is my demo.cpp code:

#include <iostream>
#include "yaml-cpp/yaml.h"
using namespace std;
using namespace YAML;

int main() {
  Node node = Load("{a: 1, <<: {a: 2}}");
  return 0;
}

The report:

segmentation fault (core dumped)

Others:
I compiled it to the /home/xxx/tRelease directory, and here is my simple CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(YAMLdemo) 

INCLUDE_DIRECTORIES(/home/xxx/TReleases/include/yaml-cpp/)
LINK_DIRECTORIES(/home/xxx/TReleases/lib/)

ADD_EXECUTABLE(demo ./demo.cpp)
TARGET_LINK_LIBRARIES(demo yaml-cpp)

os: ubuntu 18.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant