Help with tutorial 1, dll not found

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
Guest

Help with tutorial 1, dll not found

Post by Guest »

OK, I was trying the "Hello World" tutorial... now don't you dare to laugh :oops: I get no errors while compiling the code, but an error message that basically says "Irrlicht.dll not found" (My winXP isn't english). I use Visual C++ 6.0 and I just started with C++. I know some basic programming with VB and Java. What does "#pragma comment(lib, "Irrlicht.lib")" do? Can't I do it "manually" or something? Since the dll can't be found.

This is my code:

Code: Select all

#include <irrlicht.h>
using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
	IrrlichtDevice *device =
		createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16,
			false, false, false, 0);
	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();

	guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
	 rect<int>(10,10,200,22), true);

	IAnimatedMesh* mesh = smgr->getMesh("C:/Documents and Settings/Carl/Skrivbord/Irrlicht/Kopia av Files/irrlicht-0.9/media/media/sydney.md2");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

	if (node)
	{
	node->setMaterialFlag(EMF_LIGHTING, false);
	node->setFrameLoop(0, 310);	
	node->setMaterialTexture( 0, driver->getTexture("C:/Documents and Settings/Carl/Skrivbord/Irrlicht/Kopia av Files/irrlicht-0.9/media/media/sydney.bmp") );
	}

	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

	while(device->run())
	{
		driver->beginScene(true, true, SColor(0,200,200,200));

		smgr->drawAll();
		guienv->drawAll();

		driver->endScene();
	}
	device->drop();
return 0;
}
I think I got it right :? And I did like it says in the beginning of the tutorial.
We also need the location of irrlicht.lib to be listed, so select the 'Libraries' tab and add the \lib\VisualStudio directory.
IF i skip that, I get this out put:
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "Irrlicht.lib"
Error executing link.exe.

Cpp1.exe - 1 error(s), 0 warning(s)
If I do what I think is the right thing I get:
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Skipping... (no relevant changes detected)
Cpp1.cpp

Cpp1.obj - 0 error(s), 0 warning(s)
BUT... since the dll can't be found, I can't run it :cry:
Any foolprof way to link the dll? In the code itself? (to "link" is the right word?) I don't know that much yet, but I really want to. I'm usually good at finding solutions, but this is just annoying :o

Thanks in advance!
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

just copy the dll from the bin dierectory into the same directory as the executable or into your system32 directory
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Guest

Post by Guest »

#pragma comment(lib, "Irrlicht.lib")

I think this line instructs the compiler to somehow automatically link irrlicht.lib.
Mike

Post by Mike »

#pragma comment(lib, "Irrlicht.lib")

I think this line instructs the compiler to somehow automatically link irrlicht.lib.
TheApprentice
Posts: 15
Joined: Fri May 20, 2005 8:27 pm

Post by TheApprentice »

(I'm the thread starter)

Thanks a lot. I don't see the model, but thanks. It finds the dll now.

EDIT: I found a misstype, that's why the model didn't show up. I copy and pasted the path, but I did't see that it became "/media/media" instead of just "/media".
Reverie
Posts: 6
Joined: Thu May 19, 2005 12:03 pm
Location: Minneapolis, MN
Contact:

Post by Reverie »

yes, the #pragma comment tells the linker to link to that file rather then using the alternative method of setting your library file location in the project options/properties.
Error 404
Post Reply