inline vtable problems with latest kdelibs snapshot?

Frans Englich englich at kde.org
Tue May 9 18:33:04 BST 2006


On Tuesday 09 May 2006 17:13, David Faure wrote:
> 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/kebcdic1047charcodeck
> >charcodeciftest.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/a
> >ll] 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" ;)

So if I got this straight: you suggest to export classes even if their only 
requirement for the export is testing? Can't it be done in a way such that 
exporting doesn't affect production? Seems to be a pity, otherwise.

I've myself run into this problem, so it will be interesting to see if anyone 
can come up with a solution.


Cheers,

		Frans




More information about the kde-core-devel mailing list