I'm desperate about finding any information about the mentioned error.
I'm working on visual studio 2010. When I compile my project (in 32 bits), in debug or release, I get the following message :
1>heterogeneous.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString & _thiscall QString::operator=(class QString &&)" (_imp_??4QString@@QAEAAV0@$$QAV0@@Z)
1>debug\nori.exe : fatal error LNK1120: 1 unresolved externals
I linked QtCore4.lib in Linker->Input, I added Qt\4.8.2\lib to the library directories in Linker->General, and I included Qt\4.8.2\include and Qt\4.8.2\include\QtCore in C/C++->General. It seems to me that they are supposed to define QString. I don't know what else I could do.
Thank you very much for your help.
To fix this issue, add the /NOENTRY option to the link command. This error can occur if you use incorrect /SUBSYSTEM or /ENTRY settings in your project. For example, if you write a console application and specify /SUBSYSTEM:WINDOWS, an unresolved external error is generated for WinMain .
So when we try to assign it a value in the main function, the linker doesn't find the symbol and may result in an “unresolved external symbol” or “undefined reference”. The way to fix this error is to explicitly scope the variable using '::' outside the main before using it.
LNK2019 can occur when a declaration exists in a header file, but no matching definition is implemented. For member functions or static data members, the implementation must include the class scope selector. For an example, see Missing Function Body or Variable.
I had same issue, but I was using the Qt Libraries for VS2008.
I installed Qt Libraries for VS2010 to solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With