-
I'm having a bit of trouble linking This is the error I get:
It seems
And
Any pointers on where I'm going wrong is greatly appreciated 🙏. Snippet from my cmake file: # ryml
FetchContent_Declare(ryml
GIT_REPOSITORY https://github.com/biojppm/rapidyaml.git
GIT_TAG v0.4.1
GIT_SHALLOW FALSE
)
FetchContent_MakeAvailable(ryml)
add_executable(example EXCLUDE_FROM_ALL
main.cpp
)
target_link_libraries(example
PRIVATE ryml::ryml
) Basic code I'm trying to compile: #include <iostream>
#include <fstream>
#include <vector>
#include <ryml.hpp>
int main() {
std::ifstream f("conf.yaml", std::ios::binary);
std::vector<char> buf(8196, 0); // 8k buffer
std::string data;
while(f.good()) {
f.read(buf.data(), buf.size());
std::streamsize s = f.gcount();
std::cout << "read " << s << " bytes" << std::endl;
data += std::string(buf.data());
}
std::cout << "\n --- data --- \n" << data << "\n";
ryml::Tree tree = ryml::parse_in_place(ryml::to_substr(data));
} Output from cmake build generation:
|
Beta Was this translation helpful? Give feedback.
Answered by
biojppm
Jul 3, 2022
Replies: 1 comment 1 reply
-
You need to include ryml_std.hpp. This is explained in the quick start sample. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
uatuko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to include ryml_std.hpp. This is explained in the quick start sample.