toml11
toml11 copied to clipboard
`toml::parse`: Error opening file "...": iostream error
Currently, I am attempting to use toml::parse
on a file named basic_toml.toml
. When I do so, I get this error in the title. I've checked a few times and the error persists.
I am using the library by including it in the include paths.
Here is some other info:
- Compiler: g++
- Options: -g -Wall -pedantic -std=c++20
Here is the code:
// main.cpp
#include <fstream>
#include <iostream>
#include <string>
#include <toml.hpp>
int main() {
std::string toml_file_path {"./basic_toml.toml"};
const toml::value parsed_toml = toml::parse(toml_file_path);
std::cout << "Value: " << toml::find<int>(parsed_toml, "value") << '\n';
}
basic_toml.toml
value = 34