Jump to content
  • Advertisement
Sign in to follow this  
GIJoehosaphat

Setting up a D3D app in Visual C++ .NET 2003

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a small 3D app I am coding as I am learning. I am trying to implement some DirectX fonts to display stats to the screen but am having trouble at compile time. c:\dxsdk\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800 c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2146: syntax error : missing ';' before identifier 'FontDesc' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2501: 'D3DGame::D3DXFONT_DESC' : missing storage-class or type specifiers c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2501: 'D3DGame::FontDesc' : missing storage-class or type specifiers D3DGame.cpp c:\dxsdk\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800 c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2146: syntax error : missing ';' before identifier 'FontDesc' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2501: 'D3DGame::D3DXFONT_DESC' : missing storage-class or type specifiers c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.h(48) : error C2501: 'D3DGame::FontDesc' : missing storage-class or type specifiers c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(26) : error C2065: 'FontDesc' : undeclared identifier c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(26) : error C2059: syntax error : '{' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(26) : error C2143: syntax error : missing ';' before '{' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(26) : error C2143: syntax error : missing ';' before '}' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(27) : error C2059: syntax error : '{' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(27) : error C2143: syntax error : missing ';' before '{' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(27) : error C2143: syntax error : missing ';' before '}' c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(392) : error C3861: 'FontDesc': identifier not found, even with argument-dependent lookup c:\Documents and Settings\Joe\My Documents\Visual Studio Projects\Designer\D3DGame.cpp(533) : error C2660: 'ID3DXFont::DrawTextA' : function does not take 6 arguments The line of code it is initially bombing on is: D3DXFONT_DESC FontDesc; I don't believe its an error in my code as much as its an error in my setup of the project. I have the C:/DXSDK/Includes directory set, as well as some lib files linked in the project, but I can't find any info on what else I need to add to get this to work. TIA for any help! G.I.

Share this post


Link to post
Share on other sites
Advertisement
Well, I notice you are missing some semi-colons, try and fix those... that will take out a few of those errors. Then you have some errors complaining about '{' around lines 26 & 27. See if you have too many of those, missing any, or misplaced them. That should do away with most the errors. Then on line 533, inside the () after DrawTextA, you will need to add or remove arguments as needed.

Hope I helped at least somewhat. Good luck.

Share this post


Link to post
Share on other sites
No its not semicolon errors or missing or too many { }. The reason its complaining about those is because it doesn't know what this line means:

D3DXFONT_DESC FontDesc;

What I am doing is declaring a variable of type D3DXFONT_DESC, but the compiler has no idea what that type is. So it complains that there should be a ; after it, but thats just not true. If it correctly recognized that variable type, then it would work.

Thats the only line it bombs out on. If I remove it, the program compiles as expected.

So the problem is, I'm missing some file to include or such. I have <d3dx9.h> included, the compiler is told where to find the DirectX include files, I also have the following libraries linked for the debug build:

d3d9.lib
d3dx9d.lib
winmm.lib
dinput8.lib
dxguid.lib

joe...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!