Entry point problems...

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
leakingpear
Posts: 4
Joined: Mon Mar 12, 2007 2:47 pm

Entry point problems...

Post by leakingpear »

So i've got this terrible problem where it complains that it can't find the entry point for irrlicht, the error is:

The procedure entry point ?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@PBD@Z could not be located in the dynamic link library Irrlicht.dll.

The code for handling creationg of irrlicht is as follows:

Code: Select all

	
m_pEventHandler = new CIrrEventHandler();

	if(pInputElem->getName() != "irrsettings")
		return;

	irr::video::E_DRIVER_TYPE type = handleDeviceString(pInputElem->getChild("device")->parseString());

	irr::core::dimension2di resolution = irr::core::dimension2di(640, 480);

	IElement* resChild = pInputElem->getChild("resolution");
	if(resChild)
	{
		resolution.Height = resChild->getAttribute("height")->parseInt();
		resolution.Width = resChild->getAttribute("width")->parseInt();
	}

	unsigned int bpp = pInputElem->getChild("bpp")->parseInt();
	bool fullscreen = pInputElem->getChild("fullscreen")->parseBool();

	m_pIrrDevice = irr::createDevice(type, resolution, bpp, fullscreen, false, false, m_pEventHandler);
	//m_pIrrDevice = irr::createDevice();
	if(!m_pIrrDevice)
	{
		throw new CException(CException::E_CRITICAL, "CIrrHandler: Irrlicht device creation failed for unknown reason.");
		return;
	}

	m_pVideoDriver = m_pIrrDevice->getVideoDriver();
	if(!m_pVideoDriver)
	{
		throw new CException(CException::E_CRITICAL, "CIrrHandler: Irrlicht video driver failed for unknown reason.");
		return;
	}

	m_pGUIEnv = m_pIrrDevice->getGUIEnvironment();
	if(!m_pGUIEnv)
	{
		throw new CException(CException::E_CRITICAL, "CIrrHandler: Irrlicht GUI environment failed for unknown reason.");
		return;
	}

	m_pSceneManager = m_pIrrDevice->getSceneManager();
	if(!m_pSceneManager)
	{
		throw new CException(CException::E_CRITICAL, "CIrrHandler: Irrlicht scene manager failed for unknown reason.");
	}
Anyhoo any help would be absolutely fantasmagorical! It's not a runtime error in that I can limp through the code and find the exact line, it happens instantly when the program starts up.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If you are using g++ as your compiler, you need to link to the library that is in the lib/Win32-gcc directory. If you use Visual Studio you need to link to the library in the lib/Win32-VisualStudio directory.

Travis
leakingpear
Posts: 4
Joined: Mon Mar 12, 2007 2:47 pm

Post by leakingpear »

I'm using VS2005 and i'm linking to the win32-visualstudio lib, i've had it working before in the project (as a quick test before putting in my main handling code), so I don't think that's the problem unless there's something i'm missing.
Grunty
Posts: 2
Joined: Mon Mar 12, 2007 6:29 pm

Post by Grunty »

Another possibility is that you are using the incorrect dll
copy Irrlicht.dll from bin/Win32-VisualStudio to the dir of your compiled code and try running it again.

Grunty
leakingpear
Posts: 4
Joined: Mon Mar 12, 2007 2:47 pm

Post by leakingpear »

Thanks alot Grunty that fixed that problem, I must have had the wrong DLL. Now i've got a problem where it's crazy as soon as the little DOS window comes up, it again doesn't allow me to step through the code so I assume it's another error along the same sort of lines, the exception it throws is:

First-chance exception at 0x004045e6 in FYP Physics.exe: 0xC0000005: Access violation reading location 0x00000038.
Unhandled exception at 0x004045e6 in FYP Physics.exe: 0xC0000005: Access violation reading location 0x00000038.

The dissembler picks out this line:

00406716 cmp dword ptr [eax+3Ch],10h

I've tried both types of code generation DLL and normal debug, any help here would be fabbo, the only other library i'm linking to is Newton and that only has one type of DLL.
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

You're trying to grab a pointer to something that isn't there. Maybe something that you dropped or possibly something that hasn't been initiated yet.

If your event receiver is above the rest of your code, it'll give you errors on anything it touches. I recommend moving your Event receiver class to the very bottom of your code, so that when it begins receiving information, everything is already initialized.
Post Reply