inline vtable problems with latest kdelibs snapshot?
David Faure
faure at kde.org
Tue May 9 18:13:02 BST 2006
On Tuesday 09 May 2006 19:05, Friedrich W. H. Kossebau wrote:
> Hi,
>
> after I updated to the most new kdelibs snapshot some of the test in
> kdeutils/khexedit/lib/tests do not link any longer, but complain about
> undefined vtables, e.g.:
> --- 8< ---
> Linking CXX executable kebcdic1047charcodeckcharcodeciftest
> CMakeFiles/kebcdic1047charcodeckcharcodeciftest.dir/kebcdic1047charcodeckcharcodeciftest.o:
> In function `KEBCDIC1047CharCodec':
> /home/koder/Programmieren/kdesvn/trunk/KDE/kdeutils/khexedit/lib/tests/../codecs/kebcdic1047charcodec.h:44:
> undefined reference to `vtable for KHE::KEBCDIC1047CharCodec'
> collect2: ld returned 1 exit status
> make[2]: *** [khexedit/lib/tests/kebcdic1047charcodeckcharcodeciftest] Fehler
> 1
> make[1]: ***
> [khexedit/lib/tests/CMakeFiles/kebcdic1047charcodeckcharcodeciftest.dir/all]
> Fehler 2
> make: *** [all] Fehler 2
> --- 8< ---
>
> Any idea what could have triggered this?
Yes, visibility is hidden by default again, on compilers that support it (notably gcc-4.0)
For your test to link, you need the library it's linking with (libkhexedit or something)
to export the symbols that the test uses - best done using a KHEXEDIT_EXPORT
defined to KDE_EXPORT in a khexedit_export.h file, so that people compiling on
windows can later on alter that header file to redefine the macro more precisely.
Then insert KHEXEDIT_EXPORT between "class" and "KEBCDIC1047CharCodec" ;)
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list