[Qt-interest] LNK2001: unresolved external symbol "private: __cdecl QObject::QObject(class QObject const &)"

Stuart Longland redhatter at gentoo.org
Tue May 10 10:47:48 CEST 2011


[Also sent to Thiago... hit the wrong button when replying.]

Hi Thiago,

On 10/05/11 5:11 PM, Thiago Macieira wrote:
> On Tuesday, 10 de May de 2011 16:50:57 Stuart Longland wrote:
>> Hi all,
>>
>> I'm trying to compile an application in Visual Studio 2008 for a Windows
>> CE device (Psion WorkAbout PRO to be exact).  For whatever reason, the
>> link fails with just *one* of my classes.  Not any of the others derived
>> from QObject.
>
> The copy constructor for QObject is not defined. This symbol you're looking for
> simply does not exist. So you need to change your code so you don't call it.

Okay, trouble is I don't know how I'm apparently calling it.  The only
place I call a QObject constructor is when calling the object
constructor... and there I'm passing it a pointer to the "parent" QObject.

> Also, how did you manage to call a private method? Did you modify the
> qobject.h header and make your class a friend of QObject?

Magic apparently... and magic I do not like.  No modification was done
to any Qt classes.  The following is the one and only place where
QObject appears anywhere in the offending source file:

> SOAPClient::SOAPClient(const QString& endpoint, int io_timeout, QObject* parent)
> : QObject(parent) {
> 	this->proxy			= new PTrakProxy(SOAP_IO_KEEPALIVE,SOAP_IO_KEEPALIVE);
> 	this->proxy->soap_endpoint 	= strdup(endpoint.toStdString().c_str());
> 	this->proxy->send_timeout	= io_timeout;
> 	this->proxy->recv_timeout	= io_timeout;
> }

QObject(parent), where parent is a QObject* should not be calling
QObject(QObject &).  The only other place QObject appears is right up
the top of the file where I #include <QObject>.
-- 
Stuart Longland (aka Redhatter, VK4MSL)      .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer  '.'` :
. . . . . . . . . . . . . . . . . . . . . .   .'.'
http://dev.gentoo.org/~redhatter             :.'

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



More information about the Qt-interest-old mailing list