Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString & __thiscall QString::operator=(class QString &&)"

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.

like image 892
Yauda Avatar asked Sep 14 '12 16:09

Yauda


People also ask

How do I fix unresolved external symbol lnk2001?

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 .

What is an undefined reference unresolved external symbol error and how do I fix it?

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.

What is LNK2019 unresolved external symbol?

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.


1 Answers

I had same issue, but I was using the Qt Libraries for VS2008.

I installed Qt Libraries for VS2010 to solve the problem.

like image 66
Ben Beckwith Avatar answered Nov 01 '22 00:11

Ben Beckwith