@ffbodie: Sorry for the late reply. I have been very busy lately…
First of all I think @bjorn is right when he says that your path probably isn’t pointing to a file. “./” means the folder relative to the running executable, and unless you actually have created the folder “./src/level/” exactly where the .exe runs, it will not be valid. You can easily check if you have a valid path, by doing something like this:
fs::path path = fs::path("./src/level/level1.json");
bool pathExists = fs::exists(path);
Keep in mind that
fs is an alias for
std::filesystem that is used by Tileson.
If pathExists has the value true, then you are right, if not: then the path is not valid.
Since Tileson uses this functionality itself, I am fairly certain that the path you specified is not valid from where your .exe is running.
Sounds like you have recently started programming in C++. If this is the case, I would suggest you try making a regular C++ program using Visual Studio. Tileson uses CMake because it is designed to be cross-platform, but I would not recommend you to start there. Sounds like you have been able to build Tileson with its examples, which is a good start! When you built the project there is a Tileson.lib(default) or Tileson.dll file created (depending on how you configured CMake). You will need to use this when linking with your new Visual Studio project. You will also need all the header-files (*.h) related to Tileson for your project to recognize Tileson’s functions. You will need to read up on how you link libraries with Visual Studio, but it’s easy to find on the internet. Good luck!
Additional note: .lib is libraries used for static linking (they will be built into your .exe), while .dll files are not built into your .exe, and will be required inside the same folder as where your .exe is for your program to work.