CD3DFont "Undeclared Identifier" problem ...

Started by
6 comments, last by SimDemon 20 years, 10 months ago
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. =)
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Advertisement
Did you add the corresponding .cpp files to your project?
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.
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
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.


~
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)
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
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)
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Why not make a font engine? I made a font engine class, would you like to use it?
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. :-þ
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)

This topic is closed to new replies.

Advertisement