Understanding the linker error LNK2019

I have recently starting working with visual studio c++ and I am getting LNK2019 error. I understand that it usually has to do with linking up libraries. I have set up all the libraries which show up in the error messages but the errors are still there. could someone please tell me what I might be missing? Few of the error messages are below:

(I think it says it can't find directories like QString, QFileInfo etc but i have included all of them in the include path of the project)
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(void)" (__imp_??0QString@@QAE@XZ) referenced in function "int __cdecl DataInOut::writeIqFile(class std::vector<class std::complex<float>,class std::allocator<class std::complex<float> > > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool,__int64,bool)" (?writeIqFile@DataInOut@@YAHAAV?$vector@V?$complex@M@std@@V?$allocator@V?$complex@M@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@_N_J2@Z)


Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ) referenced in function "int __cdecl DataInOut::writeIqFile(class std::vector<class std::complex<float>,class std::allocator<class std::complex<float> > > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool,__int64,bool)" (?writeIqFile@DataInOut@@YAHAAV?$vector@V?$complex@M@std@@V?$allocator@V?$complex@M@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@_N_J2@Z)


Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall QFileInfo::QFileInfo(class QString const &)" (__imp_??0QFileInfo@@QAE@ABVQString@@@Z) referenced in function "int __cdecl DataInOut::writeIqFile(class std::vector<class std::complex<float>,class std::allocator<class std::complex<float> > > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool,__int64,bool)" (?writeIqFile@DataInOut@@YAHAAV?$vector@V?$complex@M@std@@V?$allocator@V?$complex@M@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@_N_J2@Z) 1

You need to tell your IDE both the location of the library files, and exactly which library files to link. Have you fed your IDE a list of names of individual library files to link, as well as a list of directories to search for those files?
1
2
3
QString::QString()
QString::~QString()
QFileInfo::QFileInfo(QString const &)

Two constructors and one destructor of Qt types.

Your code uses Qt? One should use the Qt tools to build a Qt-based application. I, for example, do use qmake to generate makefiles. Those makefiles then give linker proper instructions.

IIRC, there might be some Qt integration for MSVS. Whether or not, study the Qt documentation on how to do the build.
Yes I had to add both the directory path and the link to individual files to get rid of the errors. thanks for your help.
It's been several years since I've worked with Qt, but I remember that they used to supply an add-on module to Visual Studio, that made it easy to work with Qt inside that IDE. Do they still make that available? If so, have you tried using it?
Topic archived. No new replies allowed.