I just downloaded Irrlicht and created a project using cmake that contains the 01.HelloWorld code. I copied the media directory into my project directory (which is also the running directory) and edited the mesh loading path to "media/sydney.md2".
For some reason, Irrlicht says "Could not load mesh, because file could not be opened: : media/sydney.md2".
This shouldn't be a path issue since I can open "media/sydney.md2" using the exact same path and display its contents in the same program:
Code: Select all
std::string line;
std::ifstream myfile ("media/sydney.md2");
if (myfile.is_open())
{
while (std::getline (myfile,line) )
{
std::cout << line << '\n';
}
myfile.close();
}
else std::cout << "Unable to open file";
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("media/sydney.md2");
This correctly displays the file's contents. Does anyone know what the problem might be?
Thank you.