JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
10.93k stars 2.79k forks source link

FileSystem issue #216

Open foreverlovematrix opened 3 years ago

foreverlovematrix commented 3 years ago

when I use this Model ourModel(FileSystem::getPath("resources/objects/backpack/backpack.obj"));

it tells me that Cannot open include file:"root_directory" No such file or directory

how can find this .h and how should i implement it in my source code ?

Wesleystormrage commented 3 years ago

I met the same problem, and don't know how to deal with it. These is the error imformation: include/learnopengl/filesystem.h:24:69: error: 'logl_root' was not declared in this scope 24 | static char const * givenRoot = (envRoot != nullptr ? envRoot : logl_root);

rbarkmore commented 3 years ago

This looks similar to issue #187

Can you please try the suggestion presented in that issue and report back what happens? Thanks.

Wesleystormrage commented 3 years ago

thanks a lot! I am using windows, and I solved this problem by building for Visual Studio 16 2019. I guess platform problems are always troublesome.

wjgk0822 commented 3 years ago

thanks a lot! I am using windows, and I solved this problem by building for Visual Studio 16 2019. I guess platform problems are always troublesome.

how can build it?? can you teach cmake building path?? im really really stuck of this issue haha><

alxtrtw commented 3 years ago

In case anyone still has the problem: you don't need to use getPath functions, just comment out the filesystem.h include line, and in the stbi_load() replace the getPath functions with the directory in quotation marks.

JG-Adams commented 2 years ago

This problem had me paranoid of my compiler. I thought it was an official C++ filesystem. I tried to get the latest compiler but also hit a wall there for a while too. This was troublesome for me. Why do it like this, when you could wrap all examples in one place with access to shaders and resources locally?