Jump to content
  • Advertisement
Sign in to follow this  

Can you spot the error cause I can't

This topic is 2880 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

Hey everybody I'm working on building a Sprite class in DX 9 for my games and I'm working on some methods for loading a texture that is used with the D3DXSprite Object. Well I have a method that's supposed to load the texture from file and every time I run the program I get an error before it even runs about an unresolved external symbol and I just can't figure it out. I've looked in the DirectX help and online all over the place and I still can't find the answer so please can somebody spot the error:

The method that loads the texture from file:

IDirect3DTexture9* LoadTexture(wstring filename, D3DCOLOR transcolor)
IDirect3DTexture9* texture = NULL;

// get image info
HR(D3DXGetImageInfoFromFile(filename.c_str(), &info));

// create the new texture by loading a bitmap image file
gd3dDevice, // Direct3D device object
filename.c_str(), // image filename
info.Width, // image width
info.Height, // image height
1, // mip-map levels
D3DPOOL_DEFAULT, // the type of surface (standard)
D3DFMT_UNKNOWN, // surface format (default)
D3DPOOL_DEFAULT, // memory class for the texture
D3DX_DEFAULT, // image filter
D3DX_DEFAULT, // mip filter
transcolor, // color key for transparency
&info, // image info
NULL, // color palette
&texture); // destination texture

return texture;

In the actual app I have a texture declared as such:

IDirect3DTexture9* image_noTrans;

And here is where the lucky method is called:

image_noTrans = LoadTexture("shuttle_notrans.bmp");

Now I know that my load texture method is not the best yet I need to add some more tests for the file not being their and such but right now my focus is to get it running and then to improve from there.

Any help would be appreciated.

Share this post

Link to post
Share on other sites
Usually* "unresolved external symbol" errors are the result of libraries being linked incorrectly. Look at how you've included your header files, as well as how you've linked to the DX libraries in your project.

*Of course there's the full possibility I'm forgetting another good source of this error, so take with a grain of salt.

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!