Talk:Development/Tutorials/Saving and loading: Difference between revisions

Page contents not supported in other languages.
From KDE TechBase
(Added the necessary line for the vtable fix)
(Corrected my own error from before, vtables fixed!)
Line 5: Line 5:
</code>
</code>


Simply add the following line to the mainwindow.cpp:
I received this error, after making one tiny mistake: I named my headerfile
<code>
<code>mainwindow.hpp</code>
#include "mainwindow.moc"
instead of
</code>
<code>mainwindow.h</code>
Once renamed, everything should work fine.


Also add this line to your CMakeLists.txt near the top:
Tiny hint: if you quickly want to copy the source displayed in this tutorial, but are as annoyed as I am about the line numbering which is copied as well, use the edit function of this site to access the (barebone) sourcecode.
<code>
include (KDE4Defaults)
</code>
 
I don't exactly know why this happens to me, but I suspect the fact that I have not built any special environment for working on KDE4 applications (as described [[Getting_Started/Set_up_KDE_4_for_development#KDevelop|here]].
 
Can someone who understands the process please add the appropriate steps to the main tutorial?

Revision as of 07:05, 16 March 2008

Compiling failed due to 'undefined reference to vtable ...'

When compiling, cmake failed during the linking process. undefined reference to `vtable for MainWindow'

I received this error, after making one tiny mistake: I named my headerfile mainwindow.hpp instead of mainwindow.h Once renamed, everything should work fine.

Tiny hint: if you quickly want to copy the source displayed in this tutorial, but are as annoyed as I am about the line numbering which is copied as well, use the edit function of this site to access the (barebone) sourcecode.