D3D11 Create effect problem

Started by
14 comments, last by david_watt78 14 years, 6 months ago
Hello all, I am new to DirectX and C++ and I am trying to dev a small 3D engine to learn quickly ^^ I am facing a problem with DX11 when trying to create a effect from a compiled memory effect. Here is my code : // Compiling effect ID3D10Blob* pCompiledEffect; HRESULT hr = D3DX11CompileFromFile("ef_MinBox.fx", NULL, NULL, "Render", "fx_4_0", dwShaderFlags, 0, NULL, &pCompiledEffect, NULL, NULL); if(FAILED(hr)) { MessageBox(0, "An error occured while compiling the effect file", 0, 0); return hr; } // Creating effect ID3DX11Effect* pEffect; hr = D3DX11CreateEffectFromMemory(&pCompiledEffect, sizeof(pEffect), NULL, mD3dDevice, &pEffect); When I compiled it, I got two error saying "unresolved external symbol" for "_D3DGetInputSignatureBlob@1"2 and "_D3DReflect@16". If I comment the function "D3DX11CreateEffectFromMemory" compilation work fine. It seem like the function "D3DX11CreateEffectFromMemory" is not define, but I see it in D3dx11effect.h and I have correctly included the header file. I have also include D3dx11effectD.lib with the linker. Someone can help me ? Thank in advance.
Advertisement
you use D3DX11CompileFromMemory/File/Resource now. It does both shaders and effects. As to the error it looks like it didnot find any starting point do you have any techniques and passes in your effect file?
Yes my effect file is a small but full effect file.

But I got my error when compiling my application, not when running it. It's not the effect compilation that cause the error.
what about D3DX11.lib.
It's included, here are the lib file I added to the linker for my application.

d3d11.lib
d3dx11d.lib
d3dx10.lib
dxerr.lib
dxguid.lib
D3DX11EffectsD.lib
try using use the release libs instead of the debug ones ie anything d.lib should have the d removed.
Thank for all your help, but it still doesn't work.

I tryed with these lib as you said :

d3d11.lib
d3dx11.lib
d3dx10.lib
dxerr.lib
dxguid.lib
D3DX11Effects.lib

But I still have the same compilation error.
what do you need the 10 lib for? Maybe there is a conflict between those 2 versions of the D3DX libs.
I need it for the Vector and Matrix.

I need to include d3dx10math.h to use thing like D3DXVECTOR3 or D3DXMATRIX. And if I don't include d3dx10.lib I got external symbol error when using D3DXMatrixPerspectiveFovLH.

I tried without it to test, but I still have the same error.
Then you may need to create your own matrix class. That is what I did. Here is a link to a message post I found and used as my basis.

http://www.gamedev.net/community/forums/topic.asp?topic_id=545482

Beware Ogre I used some it and chased my tail for hours before realizing thier matrices where the opposite of D3D. IE I had to swap the columns and rows to fix it.

This topic is closed to new replies.

Advertisement