Jump to content
  • Advertisement
Sign in to follow this  
cozzie

DX11 Directxtex; Unresolved External, Lib Needed?

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

Hi all,

I've tried to replace D3DX11 texture loading by using Directxtex, advised by microsoft :)

 

So far I thought I could just download the .H and .CPP files, place them in a folder which I include in my project, and go for it.

Unfortunaly that doesn't work, my solution/ code compiles, but I get an unresolved external (like a LIB is missing or something).

 

Do you have any experience with using this library (in particular the DDS loader)?
On github I also see there's a Visual Studio project of the DDS loader/ directxtex library, I could compile that and generate a LIB, but I don't know if that's really needed to just use the DDS loader.

 

Any input is appreciated.

#include <DDSTextureLoader.h>

	// load and create 1 texture
	//HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"Textures/darkbrickdxt1.dds", 0, 0, &mDiffuseMapSRV, 0 ));

	HR(CreateDDSTextureFromFile(md3dDevice, L"Textures/darkbrickdxt1.dds", NULL, &mDiffuseMapSRV));
1>main.obj : error LNK2001: unresolved external symbol "long __cdecl DirectX::CreateDDSTextureFromFile(struct ID3D11Device *,wchar_t const *,struct ID3D11Resource * *,struct ID3D11ShaderResourceView * *,unsigned int,enum DirectX::DDS_ALPHA_MODE *)" (?CreateDDSTextureFromFile@DirectX@@YAJPAUID3D11Device@@PB_WPAPAUID3D11Resource@@PAPAUID3D11ShaderResourceView@@IPAW4DDS_ALPHA_MODE@1@@Z)
1>E:\projects\D3D11 practice\Minimal application\Release\Minimal application.exe : fatal error LNK1120: 1 unresolved externals
Edited by cozzie

Share this post


Link to post
Share on other sites
Advertisement

error LNK2001: unresolved external symbol while looking for CreateDDSTextureFromFile. Did you forget to add 'DDSTextureLoader.cpp' to your project? :)

 

A build of DirectXTex.lib from DirectXTex-master is not required for the light-weight DDS runtime loader.

Share this post


Link to post
Share on other sites
Thanks. I was afraid I had to do that. Was hoping that I could use it as an "external dependency" instead of add the source to my projects.

On github I saw that the dds and wic loader are not part of the directxtex project, so compiling that to a lib wont work either.

I'll just have to manage the files within my project.

Share this post


Link to post
Share on other sites

Thanks, I'll have to find out how to create a LIB from a H and CPP then.
But that should be managable :)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!