could not load mesh?????

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Goldor
Posts: 19
Joined: Thu Jan 18, 2007 5:49 am

could not load mesh?????

Post by Goldor »

i do exactly what is written in tutorial 1 and me compilator send me this error message :

'RPG_Demo.exe': Loaded 'C:\WINDOWS\system32\d3dx9_28.dll', No symbols loaded.
Could not load mesh, because file could not be opened.: ../../media/sydney.md2

someone could help me to know why?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

your path to the file is wrong, try printing out device->getFileSystem()->getWorkingDirectory() to make sure your working directory is what you expect it to be.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Goldor
Posts: 19
Joined: Thu Jan 18, 2007 5:49 am

special thanx

Post by Goldor »

thanks bitplane!!!!

i use changeWorkingDirectoryTo("the path");

and it's work
Gramli
Posts: 3
Joined: Sun Mar 31, 2013 4:17 pm

Re: could not load mesh?????

Post by Gramli »

i have same problem but i load irr scene which was exportet from CopperCupe4.

if (argc>1)
smgr->loadScene(argv[1]);
else
smgr->loadScene("C:/Users/User/Desktop/game0.3/game03.irr");

but could not load irrmeshes which are in "C:\Users\User\Desktop\game0.3\game03.irr.meshes"

can you help me?
sorry for my english
thanks

EDIT:
Resolved
wrong path in XML game0.3.irr

in that line:
<string name="Mesh" value="file path">
Cartms1
Posts: 2
Joined: Sat Aug 15, 2020 8:26 pm

Re: could not load mesh?????

Post by Cartms1 »

I am having this same problem.
I am using Visual Studio 2019; as Code::Blocks was having a hell of a time compiling with Irrlicht.
Further upon attempting to run the hello world example with any reference to sydney, would cause a crash.

I recompiled the library in Visual Studio 2019, as per suggestion.

I have tried C++14, and C++17. (as I have gotten warnings which state that <filesystem> does not work with !C++17)

I attempted to print the file path, but stringstream, and stdio don't seem to work with the irr::io::path variable, and none of the standard methods of path seem to function on the irr::io::path either.
Further, the only method I found in irr::io which suggested a conversion, was a private method.

I have tried changing the default directory to "E:\\Projects\\Model_Prepper","E:\\Projects\\Model_Prepper\\" but neither worked.

I have placed "sydney.md2" and its skin in every sub folder of my project in both the E:\\ drive I am using and the identical path on the C:\\ drive.

I have used the absolute path, and various iterations of "...\\ (1-4 ...\\) media\\sydney.md2"

I tried it without two dashes, as it seemed like maybe that could be an issue, but every time the error showed up, it had one dash missing from each, and
"Could not load mesh, because file could not be loaded: E:ProjectsModel_Preppermediasydney.md2" seemed wrong for some reason.

looking deeper into Irrlicht, I could see that irr will automatically cut out the first of the two, also, if I try three dashes, it will remove the first two.

Aside from not loading the mesh, nothing else fails.

It is my belief that CODE::BLOCKS was crashing due to this exact error, and I am at my wits end.

Perhaps I am missing a DLL, or such, but at this point I am considering generating my own file handling service and snipping irr::io::path out of the picture. (which i'll have to do anyways eventually but I digress)


Any help will be appreciated.
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: could not load mesh?????

Post by CuteAlien »

Hi and welcome.
Irrlicht doesn't care much about c++ version, but if you need <filesystem> in your code you need newer c++ version.
You can convert io::path to a char with my_variable.c_str(). That can then also be used in streams.

Not completely certain, but try "E:Projects\\Model_Prepper". Or generally in c++ you have an easier time if you use forward slashes "E:Projects/Model_Prepper" then you don't have to be careful about using \\ vs \ and it even works on other operating systems.

Best thing to start is usually to run the examples. Sorry, there are no VS 2019 project files, but automatic updating should work (I hope). If those work then you know it works in theory and we can figure out what's different in your code.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Cartms1
Posts: 2
Joined: Sat Aug 15, 2020 8:26 pm

Re: could not load mesh?????

Post by Cartms1 »

I am at the running the examples stage, and 1.0 hello world, wont even run.

the direction of slash had no effect.

I already built the library in 2019, that was the first thing I did.

They don't care for the C++ version... that is pretty short-sighted...

The casting to char using ".c_str()" worked instantly though, so that is some modicum of progress.

Honestly the situation is disheartening to say the least.
It looks like I might be better off just gutting this engine and morphing it to what I need, rather than rely on its inbuilt ecosystem.

As for my code, it is the sample 01 from the tutorial (Which has errors anyways, it states s32 for the window memory type rather than u32)
Honestly I don't know how someone can make code that works, and somehow publish wrong code by accident.

If i take the tutorial code, strip out anything attached directly to the getMesh() command, everything works.

The window pops up, the text shows... everything. I include only the code to load sydney into the buffer and it borks itself.
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: could not load mesh?????

Post by CuteAlien »

Doesn't care about c++ version means - Irrlicht will run with all of them so far. c++ is downward compatible and Irrlicht doesn't use anything newer than pre c++11.

Did you run the example with the project files from the examples folder?
Did your run it inside VS?

I'm asking this as generally when the examples break it's something users do different than in the examples.

And in your case - example needing <filesystem> is unlikely as Irrlicht doesn't need that. So there is probably some change. I can't help unless I know what it is.

About s32/u32 error - please when you report errors (or more likely warnings) - just copy-paste them completely instead of decribing them, otherwise it's confusing. I don't think we currently have a warning in that example, but maybe there was one in Irrlicht 1.8 (I haven't checked that in a while as I generally work with svn trunk). Which Irrlicht version are you working with btw?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply