Public Group

# Wont compile :( plz help

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

## Recommended Posts

Well im new to programming with directX and I keep getting this error when I go to complile: error LNK2001: unresolved external symbol _D3DXCreateFontA@48 Im just trying to draw some text to the screen. I create a font object by calling: D3DXCreateFont(gD3dDevice, 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Arial"), &font ) I have the dx9 sdk installed as well as the june 2005 update and im using visual studio 6. Ive added d3d9.lib d3dx9.lib to project > settings> link >object Any ideas as to why this is happening?? OK im going to add one more problem im having and this has nothing to do with my previous problem (I think). im trying to draw a sprite and it compiles fine using this code: HRESULT LoadSprite() { if(SUCCEEDED(D3DXCreateSprite(gD3dDevice,&sprite))) { D3DXVECTOR3 pos; pos.x=10.0f; pos.y=20.0f; pos.z=0.0f; sprite->Begin(D3DXSPRITE_ALPHABLEND); sprite->Draw(gTexture,NULL,NULL,&pos,0xFFFFFFFF); sprite->End(); return S_OK; } return E_FAIL; } when I run the exe it crashes right away and pops up a big message saying: Debug error! Program: c:\documents\..blah blah blah Module: File: i386\chkesp.c Line: 42 The value of ESP was not properly saved across a function call. This is usually the result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. Im following a tutorial and doing what was said. What am I doing wrong? Can it be due to how im loading the texture? Thank you for your help in advance. [Edited by - Dika on September 9, 2005 7:14:39 PM]

##### Share on other sites
Apparently, it has an error with linking. Does the file which contains the definition of the function exist?

##### Share on other sites
Well I think does exist. I mean I have the dx9 sdk installed but the only thing is when I installed the june update for it I installed into the dir that contained the original sdk files. Im not sure if I was suppose to do that or not.

##### Share on other sites
You could try a complete rebuild. Don't know what IDE you're working with, but they generally have an option in a menu named "Build" or something similar, called "Clean". That will delete all the temporary files and force it to compile them all again.

I'm using VC++ 6, and sometimes I get the same sort of thing, when I know a file is linked to or being compiled, but it still complains. Sometimes a rebuild, like above, will fix it.

##### Share on other sites
Quote:
 Original post by EndarYou could try a complete rebuild. Don't know what IDE you're working with, but they generally have an option in a menu named "Build" or something similar, called "Clean". That will delete all the temporary files and force it to compile them all again.I'm using VC++ 6, and sometimes I get the same sort of thing, when I know a file is linked to or being compiled, but it still complains. Sometimes a rebuild, like above, will fix it.

Im using vc++ 6 as well and I just tried what you said but it didnt work :( still the same problem

##### Share on other sites
try this at the top:
#pragma comment( lib, "dxguid.lib" )#pragma comment( lib, "Dinput.lib" )#pragma comment( lib, "Dinput8.lib" )

##### Share on other sites
Do any directx sample/programs compile? I thought dirextx didn't support vc6 any more, the last dx9 sdk which supported it was the october 2004 release. If you get that one, you will also need to get the "extras" package (download), as well. The extras has the libs which support vc6, you will need to link with these libs.

##### Share on other sites
nope still same prob

can some one tell me if I was suppose to install the sdk updates into the folder containing the sdk install or into a seperate folder?

##### Share on other sites
Quote:
 Original post by StevieboyDo any directx sample/programs compile? I thought dirextx didn't support vc6 any more, the last dx9 sdk which supported it was the october 2004 release. If you get that one, you will also need to get the "extras" package (download), as well. The extras has the libs which support vc6, you will need to link with these libs.

Oh damn that can be a big problem.

##### Share on other sites
If you have a broadband why not just go for visual studio 2005 beta? It can be a bit of a pain to set up & stuff to start with, but lots of people have done it so you can get help with it.

http://lab.msdn.microsoft.com/express/visualc/

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634135
• Total Posts
3015754
×