Errors when I compile any tutorial.

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
TBleader
Posts: 6
Joined: Mon Oct 04, 2010 12:43 am

Errors when I compile any tutorial.

Post by TBleader »

When I run it gives me an error stating that I do not have the irrlicht.dll on my computer. I have the code that talks about the .lib. Please help.
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

that means you dont have irrlicht.dll -.-

try putting a copy of it in C:\Windows\system or in the directory of your program when you debug
Image
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

grumpymonkey wrote:try putting a copy of it in C:\Windows\system
This is bad! Never put stuff that dont belong there in the system folders. It'll just lead to hard-to-find bugs and generall wierdness in the end.
or in the directory of your program when you debug
This is a much better suggestion. In fact, keep the dll there even when you'r not debugging, and it'll work then too!
TBleader
Posts: 6
Joined: Mon Oct 04, 2010 12:43 am

Post by TBleader »

Another problem I am now facing is, when I have anything load from the media folder (EG: "driver->getTexture("../../media/terrain-texture.jpg"));") it never loads it. Why is this? I put a copy of media in both debug and the man project folder. I tried adding the files to the solution. Nothing worked.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

driver->getTexture("../../media/terrain-texture.jpg"));
try remove the ../../ since you put the whole media folder together with your app.
TBleader
Posts: 6
Joined: Mon Oct 04, 2010 12:43 am

Post by TBleader »

It still cannot open the files.
XFactor
Posts: 39
Joined: Fri Jun 03, 2005 5:30 am

Post by XFactor »

Put it into your bin directory or use an absolute path.
IRRLICHT ROCKS!!!!
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

What does the directory structure of your project look like? And in what directory does your program execute?
example:

Code: Select all

main
  |-source
  |-gameroot [executes here]
  |-media
  |-??
TBleader
Posts: 6
Joined: Mon Oct 04, 2010 12:43 am

Post by TBleader »

Luben wrote:What does the directory structure of your project look like? And in what directory does your program execute?
example:

Code: Select all

main
  |-source
  |-gameroot [executes here]
  |-media
  |-??
It's

Code: Select all

Test (project name)
 |-Header Files
 |-media
 |-Resource Files (empty)
 |-Source Files
   -mainroot (Where the main code is)
Also I get the error

Code: Select all

Unhandled exception at 0x00a480f8 in Test.exe: 0xC0000005: Access violation reading location 0x00000000.
when I run this code, I am assuming it has to due with not being able to find the files, but I cannot rule this out. I am only using the code from the tutorials.
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi,

did you solved the Irrlicht.dll Error?
If not try this:
I always copy the .dll in my Projektname\Projektname\(place dll here) folder. Thats typical structure VC++ creates for my projects.

About Access violation, pls tell us the line and what code is in this line, and which tutorial do you exactly use?

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
TBleader
Posts: 6
Joined: Mon Oct 04, 2010 12:43 am

Post by TBleader »

The line of code is

Code: Select all

		void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
		{
//This Line			for (u32 i=0; i<getMaterialCount(); ++i)
				getMaterial(i).setFlag(flag, newvalue);
		}
And it is in the ISceneNode header file. The tutorial is the terrain rendering one. Also I fixed the .dll error by placing a copy in the debug folder.
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Please check if this pointer is zero.

If yes pls post the previous line which calls setMaterialFlag.

Maybe you have an invalid Material?

Does console say anything like "Could not load..."

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

For the scenery loading problem: depending on which IDE you use (I use Code::Blocks) the execution path of your executable might be set wrong. The Irrlicht template of Code::Blocks sets the initial execution directory (i.e. the "." directory for the executed program) to the Irrlicht folder you have chosen so that the example from the template can load all scenery. You could check the working directory with the "getWorkingDirectory" method of IFileSystem and print it to stdout so you know where you are.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Post Reply