Re: QT Errors....
*-"Brant Wells" <dafyre@hotmail.com>
|
| Howdy Y'all...
|
| I'm trying to write some QT1.42 apps; they won't compile when I issue
| the command:
|
| g++ -I /usr/local/qt/include -L/usr/X11R6/lib -lqt TestCalc.cc
|
| I get the following error messages:
|
| /usr/lib/crt1.o(.text+0x36): undefined reference to `main'
| /tmp/ccc01819: In function `TestCalc::TestCalc(QWidget *, char const
| *)':
| /tmp/ccc01819(.text+0x28): undefined reference to
| `TestCalc::QPaintDevice virtual table'
| /tmp/ccc01819(.text+0x32): undefined reference to `TestCalc virtual
| table'
| /tmp/ccc01819: In function `TestCalc::~TestCalc(void)':
| /tmp/ccc01819(.text+0x18fa): undefined reference to
| `TestCalc::QPaintDevice virtual table'
| /tmp/ccc01819(.text+0x1901): undefined reference to `TestCalc virtual
| table'
| collect2: ld returned 1 exit status
There seems to be two problems here.
1. You do not have a main function. If this file is not supposed to
have main, you should compile it with the option -c.
2. The `virtual table' thingies could be that you have
defined new signals/slots without running moc, or perhaps
running moc but not including it's output. I prefer to do
something like 'moc -o TestCalc.moc TestCalc.cc' and then
#include "TestCalc.moc" at the end of TestCalc.cc.
--
A mathematician is a machine for converting coffee to theorems
(Erd\H{o}s Pál)
olet@ifi.uio.no [-: .elOle. :-] olet@debian.org
Reply to: