Archived

This topic is now archived and is closed to further replies.

SimDemon

CD3DFont "Undeclared Identifier" problem ...

Recommended Posts

SimDemon    122
Thanks for reading my post. I am creating a font class for my game, and I need some help. I am using the files (D3DFont.h, D3DUtil.h, and DXUtil.h) in my project from the DirectX 8 SDK. When I try to compile, it gives me these errors: RR_Font.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice8 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice8@@@Z) RR_Font.obj : error LNK2001: unresolved external symbol "public: __thiscall CD3DFont::CD3DFont(char *,unsigned long,unsigned long)" (??0CD3DFont@@QAE@PADKK@Z) If there is anything else I need to include please let me know. =)

Share this post


Link to post
Share on other sites
SimDemon    122
Yes, I just tried that. Now I am having another problem. When I try to create the font, it says it''s an access violation. It shows, when I debug, that in the D3DFont.h header file, the device isn''t valid (it''s NULL), but when I take out the function for creating and drawing fonts, it works.

Share this post


Link to post
Share on other sites
Zern    138
Well, then you are trying to create the font object before the device object is created. Suggest you create a test project from the DXWizard and look where it creates the font object.


~

Share this post


Link to post
Share on other sites
SimDemon    122
This is really making me mad. I am trying everything and it still won''t work. I made a function for the font class called SetDevice() and I call it before RR_Font::CreateNewFont(), and when I debug it says, int the RR_Font::SetDevice() function, is this:

if (m_pDevice != NULL) // Valid d3d8 device object
m_pDevice = pDevice; // Copy object (DEBUG POINTS TO THIS LINE)

Share this post


Link to post
Share on other sites
SimDemon    122
This is really making me mad. I am trying everything and it still won''t work. I made a function for the font class called SetDevice() and I call it before RR_Font::CreateNewFont(), and when I debug it says, int the RR_Font::SetDevice() function, is this:

if (pDevice != NULL) // Valid d3d8 device object
m_pDevice = pDevice; // Copy object (DEBUG POINTS TO THIS LINE)

Share this post


Link to post
Share on other sites
SimDemon    122
No thanks. I got it to work. I am not sure why, but when I call CD3DFont::InitDeviceObjects(...), I have to call CD3DFont::RestoreDeviceObjects() right after it. I got the main menu for my game so far. I hope to post a screenshot soon. :-þ

Share this post


Link to post
Share on other sites