Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Linking error caused by adding DxErr.lib

4: Adsense

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   

5032
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.


My current game project Platform RPG

#2 HappyCoder   Members   

5032
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.


My current game project Platform RPG

#3 Tribad   Members   

981
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.