[Qt-interest] finddialog example linker error

Mark Summerfield list at qtrac.plus.com
Wed Dec 16 10:25:09 CET 2009


On 2009-12-15, Radu Ilinca wrote:
> Hi All !
>  
> I am trying to implement the findDialog example from the Qt book (page
> 19). I run Qt in Visual Studio 2009, Win XP.  I have the exact linker
> error they suggest (Visual Studio) , I do the steps they tell (run
> qmake) then rebuild but it doesnt work. I still get the errror:
> 1>MyDialog.obj : error LNK2001: unresolved external symbol "public:
> virtual int __thiscall MyDialog::qt_metacall(enum
> QMetaObject::Call,int,void * *)"
> (?qt_metacall at MyDialog@@UAEHW4Call at QMetaObject@@HPAPAX at Z) 
> Thanks,
> Radu.

I don't think there's any problem with the example; the link error
suggests to me that when you build the example moc isn't being run.

I thought that there was a Visual Studio plugin for Qt? If there is you
ought to use it to open the .pro file; that way it will tell the IDE all
the rules needed to build Qt apps, including how and when to run uic and
moc.

I personally don't use any IDEs; on Windows I use MinGW from the command
line.

You could try opening a console window changing directory to the
example's directory and doing:

    C:\...> make distclean
    C:\...> qmake
    C:\...> make
    C:\...> debug\finddialog.exe

(Obviously you might have to use nmake, and you might have to run it
from release\finddialog.exe, and you might have to give the full path to
qmake.)


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Python 3 (Second Edition)" - ISBN 0321680561



More information about the Qt-interest-old mailing list