Reputation: 118
Ok, so I'm learning DirectX 11 and tried the BoxDemo Code from Frank D Luna's Introduction to Direct3D. But I am getting the following Linker Error :
Effects11.lib(EffectAPI.obj) : error LNK2001: unresolved external symbol D3DCompileFromFile
I have heard that I have to build the Effects11.lib in release and debug mode. And I kinda suck in this too. What I did was go to Samples\C++\Effects11\ folder. Opened the solution in VS2012 and built it got the Effects11.lib in Release and also in Debug mode. Renamed the debug one Effects11d.lib. Placed both the libs in the project folder and added them in the Linker->Input->Additional Dependencies. My target platform is x64 and my include directory is currently pointing to directx include and lib directory likewise.
So what is my problem ? Why the Effects11.lib cannot be found by the compiler ?? Am I doing it right ? Please help me . Thanks in Advance
Edit : So my problem lies may be with d3dcompiler.lib. But I have already added the d3dcompiler.lib in linker->input. But when building the Effects11.lib do I have to add d3dcompiler.lib too ?
Upvotes: 1
Views: 2913
Reputation: 118
Try linking the Effects11.lib in release mode and Effects11d.lib in debug mode. The writer Frank D Luna used the default path I used that and worked for me. And other paths did not work for me. Still not sure
Upvotes: 1
Reputation: 3813
The issue is not that Effects11.lib cannot be found. What the compiler is telling you is that a symbol from Effects11.lib (in this case, D3DCompileFromFile) cannot be found at link time.
You need to link the library which contains D3DCompileFromFile, which appears to be D3dcompiler.lib, according to http://msdn.microsoft.com/en-us/library/windows/desktop/hh446872.aspx.
Upvotes: 0