Jump to content
  • Advertisement
Sign in to follow this  
Micronaut

D3DXSaveSurfaceToFile error 1120

This topic is 2855 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 am running DirectX 9 through 11 on Visual C++ Express and most of the features are running fine, but when I try to use D3DXSaveSurfaceToFile, D3DXLoadSurfaceFromFile or any other related function I get: 1>AGSpiral.obj : error LNK2001: unresolved external symbol _D3DXSaveSurfaceToFileW@20
AND fatal error LNK1120: 1 unresolved externals. I have configured the include and lib folders for DirectX SDK, and added what is supposed to be in the Linker Input.
Here is the code the generated the previous error:
/////////////////
IDirect3DSurface9* pSurface;
g_pDevice->CreateOffscreenPlainSurface(SCREEN_WIDTH, SCREEN_HEIGHT,
D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL);
g_pDevice->GetFrontBufferData(0, pSurface);
D3DXSaveSurfaceToFile(L"C:\\Desktop.bmp",D3DXIFF_BMP,pSurface,NULL,NULL);
pSurface->Release();
/////////////////
(const int SCREEN_WIDTH = 1366; and const int SCREEN_HEIGHT = 768;)
If I comment out the D3DXSaveSurfaceToFile call the program compiles fine.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Micronaut
and added what is supposed to be in the Linker Input.


Post exactly what this includes, and double-check that d3dx9.lib is really there.

Share this post


Link to post
Share on other sites
You need to add d3dx9.lib to your programs additional dependencies in Project Settings (Alt+F7) -> Configuration Properties -> Linker -> Input -> Additional Dependencies (And you want d3dx9d.lib in debug builds).

EDIT: Bah, too slow [smile]

Share this post


Link to post
Share on other sites
My Linker settins are: Configuration Properties>Linker>Input>Additional Dependencies>dxguid.lib;d3d9.lib;d3dx9.lib;etc.

Share this post


Link to post
Share on other sites
Try calling D3DXSaveSurfaceToFileA (note: A, not W) directly and see what happens. I'm not proposing this as a solution (and wouldn't recommend that you do it), just a test to see if your problem is character set related.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!