User forums > General (but related to Code::Blocks)

Qt and undefined reference to ‘vtable

(1/2) > >>

arquist:
I need explicit instructions on using Code::Blocks with Qt Please.  :?

System Configuration:
-   Windows XP Pro
-   Qt 4.2.2
-   MinGW
-   Code::Blocks (Mar 7 2007, 16:52:13-wx2.6.3)

Background:
-   I’ve been writing C++ code for a while, but new to GUI’s
-   Have Qt working from command line (qmake, make, etc)
-   Have Qt working with MS-VS.net (qmake –t vcapp, etc)
-   C::B new Qt project template works fine, as long as I don’t try to add other source files.

OK, when I try to add additional source files, they compile, but I get “undefined reference to ‘vtable for …’ when linking.  This has to do with not generating MOC file, etc.  How do I fix this.  I need explicit instructions please.

Another thing, is that if I include Qt classes that are not in QtGUI the includes are not found.  I can fix this by adding the paths to the cbp file. Is there a better way to take care of this?

Thanks so much for the help
ARQuist

iw2nhl:
- "undefined reference to ‘vtable for …"
after adding classes that inherit QObject and have Q_OBJECT functionalities (like signals and slots) you have to manually launch "qmake" (without any parameter), because it has to regenerate the makefile adding the calls to MOC files for the new classes.
- make the previous step easier using the QtWorkbench plugin
http://forums.codeblocks.org/index.php/topic,2253.0.html

indigo0086:
Check to see if your destructor is implemented, I've gotten that before and it turned out to be the destructor being declared but not defined.  I hear it's quite common.

arquist:
Thanks,
Sounds like qtworkbench is for me.  However, after much work (setting up wxWidgets and codeblocks) I try to build qtworkbench (can't find a reference to a windows binary - sure would be nice) and get:

"Execution of 'zip -j9 ..\..\..\devel\share\codeblocks\qtworkbench.zip res\*.xrc' in 'C:\CodeBlocks\src\plugins\contrib\qtworkbench' failed."

I take it I need a zip (I have winzip and 7-zip), but which one?

Thanks

ARQuist

TDragon:

--- Quote from: arquist on March 13, 2007, 12:53:40 am ---I take it I need a zip (I have winzip and 7-zip), but which one?

--- End quote ---
Info-ZIP (latest Windows binary package available at ftp://sunsite.icm.edu.pl/pub/unix/archiving/info-zip/WIN32/zip232xN.zip). Make sure the path to zip.exe is in your PATH environment variable.

Navigation

[0] Message Index

[#] Next page

Go to full version