Jump to content

  • Log In with Google      Sign In   
  • Create Account

Linking error caused by adding DxErr.lib


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 HappyCoder   Members   -  Reputation: 2878

Like
0Likes
Like

Posted 22 June 2014 - 01:03 AM

I am working on a DirectX project and I can build and link the project just fine without adding DxErr.lib to the project. When I add the line

#pragma comment (lib, "DxErr.lib")

To include the library, without even referencing it, I get a linking error to D3D11CreateDevice even though that function is defined in d3d11.lib.

 

Error 1 error LNK2019: unresolved external symbol _D3D11CreateDevice@40 referenced in function "public: __thiscall DX11Graphics::DX11Graphics(void)" (??0DX11Graphics@@QAE@XZ) DX11Graphics.obj DeferredRendering

If I don't include DxErr.lib then it links just fine.

 

Any thoughts as to why this is happening? This problem has me stumped.



Sponsor:

#2 HappyCoder   Members   -  Reputation: 2878

Like
0Likes
Like

Posted 22 June 2014 - 01:07 AM

So I have been trying to fix this for a few hours now, and it turns out I just needed to include the 32 bit version of DxErr.lib instead of the 64 bit version. I seriously figured that out right after posting this question.

 

Even though it is working now I would still like to know if anybody has an explanation as to why it would work like that.



#3 Tribad   Members   -  Reputation: 887

Like
1Likes
Like

Posted 22 June 2014 - 02:09 AM

If you create a 32-Bit application you need to use the 32-Bit libraries. This is independent of whether the operating system is 64-bit or 32-bit. This has something todo with the ABI (application binary interface) and AFAIK on Windows with the exception handling that has been changed massivly.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS