Linker error for D3D9RenderSystem

Problems building or running the engine, queries about how to use features etc.
Ephon
Gnoblar
Posts: 18
Joined: Tue Jan 18, 2005 8:33 pm

Linker error for D3D9RenderSystem

Post by Ephon »

Hi

I get an error when linking this code:

Code: Select all

INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
{
	try
	{
		Root *pRoot = new Root();
		RenderSystem *pRenderSystem = new D3D9RenderSystem(hInst);
	}
	catch(Ogre::Exception &e)
	{
		MessageBox(
			NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
	}
}
The error is:
error LNK2019: unresolved external symbol "public: __thiscall Ogre::D3D9RenderSystem::D3D9RenderSystem(struct HINSTANCE__ *)" (??0D3D9RenderSystem@Ogre@@QAE@PAUHINSTANCE__@@@Z) referenced in function _WinMain@16

Path to the library for the RenderSystem is set, and I'm using the debug version.

Any help on this issue is appreciated.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

You shouldn't create your own D3D9RenderSystem, as the plugin constructs itself on DLL loading. The way to set the rendersystem is through the ogre root object.
Ephon
Gnoblar
Posts: 18
Joined: Tue Jan 18, 2005 8:33 pm

Post by Ephon »

Then how shall I aquire D3D9RenderSystem directly in program code and setting it through Root.setRenderSystem?

Shall I retrieve a list of available renders, query its name and choose from that list? Or is there are better way?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

If you already know it's name you can just use that; the name will never change. Setting it by name is the only option though.
Ephon
Gnoblar
Posts: 18
Joined: Tue Jan 18, 2005 8:33 pm

Post by Ephon »

How come I dont get any renderers when I call root->getAvailableRenderers() method?

The vector returned contains 0 items.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

Try loading one or more rendersystem plugins first!