Problems referencing libraries on W7
I could use some help getting my App to reference a library. Thanks in advance:
OS: W7, 64bit
Qt 5.5 for VS 2013 w/Creator 3.4.2
Visual Studio 2013
I created a library with VS2013 followig the pattern outlined here:
Following Qt documetntation (http://doc.qt.io/qt-5/third-party-libraries.html), I added the following line to my *.pro file
LIBS += -L"C:\Users\xxxxxxxx\Documents\CASES_PC\CPP\lib\static" -lVS_casesIO
(the actual library name is VS_casesIO.lib)
I ran Qmake. There were no errors or warning from this process that I could see.
When I tried to run I got:
prjpath.obj:-1: error: LNK2001: unresolved external symbol "public: __cdecl PrjFilePath::PrjFilePath(char const *)" (??0PrjFilePath@@QEAA@PEBD@Z)
What am I doing wrong? Thanks to all.
PRE_TARGETDEPS += "C:\Users\xxxxxxxx\Documents\CASES_PC\CPP\lib\static\VS_casesIO.lib"
to my project file and go the same results... (yes, I reran qmake)
Maybe a silly question but, are you sure that the library and Qt are build for the same architecture ? 32 vs 64 bit.
Never really thought about it, but since I am using Qt for VS2015, and I used VS2015 to build the library, all on the same machine, I kinda figured it was all consistent. How do I check?
Something's not clear here, in your first post you wrote that you where using Visual Studio 2013, did you change in between ?
You can check the architecture in your project's settings or using a tool like Dependency Walker.
My bad Vs2013 it is .
It looks like the Qt build is 64 bit (From Projects | Build directory):
Indeed it is. Therefore is VS_casesIO.lib also 64bit ?
@SGaist I sure expect so, but can;t figure out at the moment. Still a bit new to VS2013 as well...
Then get Dependency Walker, it will be faster. When the library is loaded there's a 64 icon if it's a 64 bit build.