[Qt-interest] Build problem when using QtSingleApplication solution

Ross Driedger ross at earz.ca
Tue Nov 17 20:30:22 CET 2009


On Tue, 17 Nov 2009 12:02:10 -0500, <qt-interest-request at trolltech.com>  
wrote:

> ------------------------------
> Message: 3
> Date: Tue, 17 Nov 2009 16:58:31 +0000
> From: Marcus Williams <marcus-qt at quintic.co.uk>
> Subject: [Qt-interest] Build problem when using QtSingleApplication
> 	solution
> To: Qt-interest at trolltech.com
> Message-ID: <4B02D637.3070601 at quintic.co.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Hi -
> I'm trying to use the QtSingleApplication - I can build the component
> and its examples. The examples work.
> However... if I try to use it in a qt application that extends
> QApplication (so we have a MyApp class that extends QApplication) I get
> the following build error when we change it to extending
> QtSingleApplication:
> 1>moc_MyApp.obj : error LNK2001: unresolved external symbol "public:
> static struct QMetaObject const QtSingleApplication::staticMetaObject"
> (?staticMetaObject at QtSingleApplication@@2UQMetaObject@@B)
> 1>D:\Projects\hii-testtrunk\MVS\VS2008\MVS\Debug\MVS.exe : fatal error
> LNK1120: 1 unresolved externals
> I can solve this by building the singleapplications moc file
> (moc_qtsingleapplication.cpp) as part of our project, but I'm not sure
> this is what I should be doing as this doesnt seem necessary in the
> example code.

Providec the .pri is referred to in your .pro, qmake should put the  
necessary references to the files into the Makefiles.  What version are  
you running?  I'm using 4.5.1 on windows and 4.5.2 on Mac/*NIX (both  
commercial) with no problems.

> I have built the QtSingleApplication as a dll, and I have
> linked against the QtSingleApplication lib file during the link step for
> building MyApp.

I'm a bit confused.  You are using the solution as part of a DLL?  Isn't  
the point of a DLL to serve a number of different possible applications  
and application instances?

My use of this solution happens very early in the main function of an  
application project, as I have written software that requires single  
instances as a requirement.

> So a few questions: should this be necessary? and is the LGPL
> "triggered" by building the moc file into our code or is this covered by
> the LGPL exception distributed with the QtSingleApplication solution?

I have no experience with the LGPL version -- sorry.  My license was  
required for installation, but beyond that I don't think it checks.


-- 
"Music must rank as the highest of the arts -- more than any other, it  
ministers to human welfare. "
Herbert Spencer

Ross Driedger
ross_at_earz.ca



More information about the Qt-interest-old mailing list