Directxtex; Unresolved External, Lib Needed?

Started by
3 comments, last by cozzie 7 years, 8 months ago

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

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

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.

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.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

You could just create a separate project as static lib for those files yourself.

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

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement