0

I have a static library project that I am trying to use in a Win32 form project. I am using visual studio and C++. Here is what I have done:

  • Added the library project to the solution.
  • Included the library project's header in stdafx.h of the form project (#include "..\libproj\libProj.lib")
  • Linked the static library file itself using pragma (#pragma comment(lib,"..\libproj\Release\libProj.lib")
  • Added a reference to the library project in "Common Properties > Framework and References".

But when I try and compile the form application I get numerous unresolved external symbol errors. I just don't know what I am doing wrong. Currently I am getting round this problem by adding the .cpp file of the library project to the windows forms project. Any help would be greatly appreciated!

Raiden616
  • 1,545
  • 3
  • 18
  • 42
  • could you show us the errors? – okaerin Feb 10 '14 at 10:53
  • I actually can't right now - my office internet is down so I'm asking the question from my iPad. I can tell you the only output lines that show up as "error" are purely unresolved external symbol errors for every time a function inside the library is called. – Raiden616 Feb 10 '14 at 10:56
  • Do you use the same Runtime Library for both projects? (Config. Properties>C/C++>Code Generation>Runtime Library) – Peopleware Feb 10 '14 at 11:15
  • "differing calling conventions in the client and the precompiled library usually result in an unresolved error during linking", from: http://www.gamedev.net/page/resources/_/technical/general-programming/static-library-tips-r1583 – Peopleware Feb 10 '14 at 11:20
  • Yes the same runtime library is used. – Raiden616 Feb 11 '14 at 14:07

0 Answers0