toml11 icon indicating copy to clipboard operation
toml11 copied to clipboard

`toml::parse`: Error opening file "...": iostream error

Open FuexFollets opened this issue 1 year ago • 1 comments

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

FuexFollets avatar Jan 23 '23 13:01 FuexFollets