Game engine lib problems

Started by
10 comments, last by Norman Barrows 11 years, 1 month ago

What definitions do you need d3dx9.h for anyway?

I'm using the D3DXSprite, D3DXMATRIX, etc... , if thats what you are asking for? Appearantly, I'd additionally need to tell the linker to link to the d3d9.lib, as well as the d3dx9 and some other libs. Gosh, I hate Windows 8 :/

Well now granted I did, since its OK for now (going to test if this persists on Windows 7 tomorrow) c+p all the include and link stuff from my engine project. I still get some unresolved symbol errors. Well, at least we are partially in the territory of the game project now:


1>LightAttributeCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiObject::OnKeyStroke(char)" (?OnKeyStroke@GuiObject@@UAEXD@Z)
1>MaterialAttributeCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiObject::OnKeyStroke(char)" (?OnKeyStroke@GuiObject@@UAEXD@Z)
1>ObjectAttributeCtrl.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GuiObject::OnKeyStroke(char)" (?OnKeyStroke@GuiObject@@UAEXD@Z)

Whereas the function is declared as :


class GuiObject {  
...
  virtual void OnKeyStroke(TCHAR key);
...
}

and defined as


void GuiObject::OnKeyStroke(TCHAR key)
{
}

I won't post the whole GuiObject.h code since it is really huge and probably contains nothing to help solve the problem. <Windows.h> is included in the header, however, so is GuiObject.h to each of the Controller-classes throwing the error. Some ideas why it could be crashing on this very function? Ouch, silly me, forgot to set the new project to unicode. Hrmpf. Could slap myself for this. Anyway, for now it is working, except this one very annoying need-to-include-stuff-thats-already-included-in-my-engine - thing. Out of interest, how does other engines handle this? Did the windows 8 SKD completely drop the d3dx9-stuff or is there any other way to correctly include it?

Advertisement

Out of interest, how does other engines handle this?

i was going to say, you seem to be doing it the hard way.

don't make the game library a separate project. just make it an existing .cpp and .h file you add to your game project.

IE just another module.

only difference, this module has generic reusable code and is include in many different game projects, instead of being game specific and used in just one project..

always set your compiler options first when you start a new project. I keep a 3 page list of all the correct settings for a release build of any game. this avoids stuff like wrong char type. that one bites me a lot too, hence the lists, way too much to memorize.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement