Summary: | pykde4 fails to compile | ||
---|---|---|---|
Product: | [Unmaintained] bindings | Reporter: | Benjamin Schulz <Benjamin_Schulz> |
Component: | general | Assignee: | kde-bindings |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 2Kmm, cgirlanda, erik, gavinlee303, gokmen, kavol, simon, stefnn |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Benjamin Schulz
2008-12-21 10:27:52 UTC
I am on Gentoo as well but compiling KDE from trunk using kdesvn-build. python-2.5.2 installed into ~/kde sip-4.7.9 PyQt-4.4.4 Trying to build pykde4 from kdebindings fails with same error, curious how we are both on Gentoo, maybe that is something to do with it? I've been unable to build pykde4 from trunk since i started using kdesvn-build last year :( CMakeFiles/python_module_PyKDE4_plasma.dir/sip/plasma/sipplasmapart0.o: In function `void* qMetaTypeConstructHelper<Plasma::Containment::StyleOption>(Plasma::Containment::StyleOption const*)': /home/kde4test/qt4/include/QtCore/qmetatype.h:123: undefined reference to `Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&)' /home/kde4test/qt4/include/QtCore/qmetatype.h:122: undefined reference to `Plasma::Containment::StyleOption::StyleOption()' CMakeFiles/python_module_PyKDE4_plasma.dir/sip/plasma/sipplasmapart6.o: In function `init_Plasma_Containment_StyleOption': /home/kde4test/kdesvn/build/kdebindings/python/pykde4/sipplasmapart6.cpp:4788: undefined reference to `Plasma::Containment::StyleOption::StyleOption(QStyleOptionGraphicsItem const&)' /home/kde4test/kdesvn/build/kdebindings/python/pykde4/sipplasmapart6.cpp:4764: undefined reference to `Plasma::Containment::StyleOption::StyleOption()' /home/kde4test/kdesvn/build/kdebindings/python/pykde4/sipplasmapart6.cpp:4776: undefined reference to `Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&)' collect2: ld returned 1 exit status distcc[10819] ERROR: compile (null) on localhost failed make[2]: *** [lib/pykde/plasma.so] Error 1 make[1]: *** [python/pykde4/CMakeFiles/python_module_PyKDE4_plasma.dir/all] Error 2 Many others have the same bug: http://www.gentoo.ru/node/12855 However, I believe the reason for it coming only in view of gentoo users, is, that gentoo users are actually compiling kde itself. Ohter distros use precompiled packages. However, this bug is very problematic. For example, the new printing module of KDE4 depends on pykde4. It cannot be, that all those, who compile kde4 by themselves cannot install the printer module because of this stupid pykde4 failure. same problem here with gentoo ebuild from kde-testing overlay with both pykde4-4.1.85 and pykde4-4.1.87. Which compiler are you guys using? Hi, I confirm this error. (In reply to comment #4) > Which compiler are you guys using? I have test gcc 4.1.2 (gcc-config: i686-pc-linux-gnu-4.1.2) gcc 4.3.2 (gcc-config: i686-pc-linux-gnu-4.3.2) with the same error. I have try to download kdebindings 4.1.85 source and compile fail with same error. Now I check with 4.1.87; I suspect problem is in kdelibs compilations. using gcc version 4.1.2 as above. I tested it with pykde4-1.87. Under my system with gcc 4.1.2 under CFLAGS="-O2 -mtune=prescott -pipe -fomit-frame-pointer", compilation fails with the same error. By the way, I think this bug should get more votes and it is more severe than "normal". (In reply to comment #7) > I tested it with pykde4-1.87. > Under my system with gcc 4.1.2 under CFLAGS="-O2 -mtune=prescott -pipe > -fomit-frame-pointer", compilation fails with the same error. I can build it successfully under Pardus 2008 with gcc 4.3.2 and the following settings; cflags = -mtune=generic -march=i686 -O2 -pipe -fomit-frame-pointer -fstack-protector -D_FORTIFY_SOURCE=2 same for cxxflags And we also build all kde packages from source.. When I run this command below I get the following output: strings libplasma.so | c++filt | grep Plasma::Containment::StyleOption Plasma::Containment::StyleOption::StyleOption(QStyleOptionGraphicsItem const&) Plasma::Containment::StyleOption::StyleOption(QStyleOptionGraphicsItem const&) Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&) Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&) Plasma::Containment::StyleOption::StyleOption() Plasma::Containment::StyleOption::StyleOption() This shows that my libplasma contains the needed StyleOption symbols. People who are having trouble with this issue, should also check their libplasma and see if it contains StyleOption. The real problem appears to be in the compilation of libplasma. The only special thing I can see about StyleOption (defined in containment.h) is that it is a nested class inside an exported class. StyleOption itself doesn't have its own PLASMA_EXPORT. Maybe there is a difference in the compilers with respect to has this is handled. Should the nested class also be exported?? Perhaps someone could try added a PLASMA_EXPORT to the StyleOption declaration and see if that helps. Thank you simon. On my system, after cd /usr/lib and strings libplasma.so | c++filt | grep Plasma::Containment::StyleOption there is NO output. I repeat no output. If I type strings libplasma.so | c++filt | grep Plasma::Containment I get the following output: Plasma::Containment::staticMetaObject Plasma::Containment::activity() const Plasma::Containment::drawWallpaper() Plasma::Containment::wallpaper() const Plasma::Containment::Containment(QGraphicsItem*, QString const&, unsigned int) Plasma::Containment::containmentType() const Plasma::Containment::showDropZone(QPoint) Plasma::Containment::screen() const Plasma::Containment::desktop() const Plasma::Containment::toolBoxItem() const Plasma::Containment::openToolBox() Plasma::Containment::closeToolBox() Plasma::Containment::setToolBoxOpen(bool) Plasma::Containment::metaObject() const Plasma::Containment::contextChanged(Plasma::Context*) Plasma::Containment::configureRequested(Plasma::Containment*) Plasma::Containment::screenChanged(int, int, Plasma::Containment*) Plasma::Containment::showAddWidgetsInterface(QPointF const&) Plasma::Containment::addSiblingContainment(Plasma::Containment*) Plasma::Containment::addSiblingContainment() Plasma::Containment::toolBoxToggled() Plasma::Containment::zoomRequested(Plasma::Containment*, Plasma::ZoomDirection) Plasma::Containment::appletRemoved(Plasma::Applet*) Plasma::Containment::appletAdded(Plasma::Applet*, QPointF const&) Plasma::Containment::qt_metacast(char const*) Plasma::Containment::applets() const Plasma::Containment::addToolBoxAction(QAction*) Plasma::Containment::showConfigurationInterface() Plasma::Containment::removeToolBoxAction(QAction*) Plasma::Containment::resizeEvent(QGraphicsSceneResizeEvent*) Plasma::Containment::corona() const non-virtual thunk to Plasma::Containment::~Containment() non-virtual thunk to Plasma::Containment::~Containment() Plasma::Containment::~Containment() non-virtual thunk to Plasma::Containment::mouseReleaseEvent(QGraphicsSceneMouseEvent*) Plasma::Containment::mouseReleaseEvent(QGraphicsSceneMouseEvent*) non-virtual thunk to Plasma::Containment::mousePressEvent(QGraphicsSceneMouseEvent*) Plasma::Containment::mousePressEvent(QGraphicsSceneMouseEvent*) non-virtual thunk to Plasma::Containment::mouseMoveEvent(QGraphicsSceneMouseEvent*) Plasma::Containment::mouseMoveEvent(QGraphicsSceneMouseEvent*) non-virtual thunk to Plasma::Containment::wheelEvent(QGraphicsSceneWheelEvent*) Plasma::Containment::wheelEvent(QGraphicsSceneWheelEvent*) non-virtual thunk to Plasma::Containment::dragMoveEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::dragMoveEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::Containment(QObject*, QList<QVariant> const&) Plasma::Containment::Containment(QObject*, QList<QVariant> const&) Plasma::Containment::setFormFactor(Plasma::FormFactor) non-virtual thunk to Plasma::Containment::keyPressEvent(QKeyEvent*) Plasma::Containment::keyPressEvent(QKeyEvent*) non-virtual thunk to Plasma::Containment::sceneEventFilter(QGraphicsItem*, QEvent*) Plasma::Containment::sceneEventFilter(QGraphicsItem*, QEvent*) Plasma::Containment::clearApplets() Plasma::Containment::focusPreviousApplet() Plasma::Containment::focusNextApplet() non-virtual thunk to Plasma::Containment::itemChange(QGraphicsItem::GraphicsItemChange, QVariant const&) Plasma::Containment::itemChange(QGraphicsItem::GraphicsItemChange, QVariant const&) Plasma::Containment::removeAssociatedWidget(QWidget*) Plasma::Containment::addAssociatedWidget(QWidget*) Plasma::Containment::setLocation(Plasma::Location) Plasma::Containment::~Containment() non-virtual thunk to Plasma::Containment::~Containment() non-virtual thunk to Plasma::Containment::~Containment() Plasma::Containment::~Containment() Plasma::Containment::saveContents(KConfigGroup&) const Plasma::Containment::save(KConfigGroup&) const Plasma::Containment::destroy(bool) Plasma::Containment::qt_metacall(QMetaObject::Call, int, void**) Plasma::Containment::destroy() Plasma::Containment::setActivity(QString const&) Plasma::Containment::setWallpaper(QString const&, QString const&) Plasma::Containment::setDrawWallpaper(bool) Plasma::Containment::enableAction(QString const&, bool) Plasma::Containment::setScreen(int, int) Plasma::Containment::restore(KConfigGroup&) Plasma::Containment::setContainmentType(Plasma::Containment::Type) Plasma::Containment::init() Plasma::Containment::Containment(QGraphicsItem*, QString const&, unsigned int) non-virtual thunk to Plasma::Containment::dragEnterEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::dragEnterEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::listContainmentsForMimetype(QString const&) Plasma::Containment::addApplet(Plasma::Applet*, QPointF const&, bool) Plasma::Containment::addApplet(QString const&, QList<QVariant> const&, QRectF const&) Plasma::Containment::showContextMenu(QPointF const&, QPoint const&) non-virtual thunk to Plasma::Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent*) Plasma::Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent*) Plasma::Containment::restoreContents(KConfigGroup&) non-virtual thunk to Plasma::Containment::dropEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::dropEvent(QGraphicsSceneDragDropEvent*) Plasma::Containment::listContainments(QString const&, QString const&) Ok, in my system is the same: >On my system, after cd /usr/lib and strings libplasma.so | c++filt | grep >Plasma::Containment::StyleOption >there is NO output I compile kdelibs from source (not gentoo ebuild) with very simple cmake and the result is the same. Now I try: >Perhaps someone could try added a PLASMA_EXPORT to the StyleOption declaration and see if that helps. Simon wrote: Should the nested class also be exported?? Yes, It must be! Anything else would be a kind of inofficial compiler hack which may only work on certain architectures and (faulty) gcc versions. According to c++ rules, all symbols must be explicitely exported. In fact, after adding PLASMA_EXPORT to the StyleOption class in containment.h, I could compile pykde4 sucessfully! Thanks to Simon that point all in right direction... Like Benjamin, i rebuild kdelibs via ebuild command changing: kdelibs-4.1.87/plasma/containment.h: change line 72 from class StyleOption : public QStyleOptionGraphicsItem to class PLASMA_EXPORT StyleOption : public QStyleOptionGraphicsItem Now, pykde4 compile fine. Now I mail to ebuild mantainer for creating a patch for gentoo world, but I think is better including this explicit export in kde source. hey Claudio, you're a life saver, Thanks !!! Claudio saw this bug on two gcc versions: gcc 4.1.2 (gcc-config: i686-pc-linux-gnu-4.1.2) gcc 4.3.2 (gcc-config: i686-pc-linux-gnu-4.3.2) I'm still left wondering which piece of software is at fault here. I'm using 4.3.2 here and don't have any problems. I guess the problem must be some where else in the tool chain. AFAIK this bug is amd64 only. x86 seem to work. (In reply to comment #16) > AFAIK this bug is amd64 only. x86 seem to work. it failed on my x86 system too ... I am using x86. For Simon: When pykde4 fail to compile, i check: a) change gcc (switch to 4.1.2), and recompile pykde4: failed b) Searching, I find pykde4 ebuild is part of kdebindings official source. I download and compile kdebindings with both compiler and fail (same error) c) In that moment, I suspect in kdelibs...and read your post. d) Now I compile from official source kdelibs-4.1.87 and check with strings | c++... as you suggest: - gcc 4.3.2 compile correctly - gcc 4.1.2 compile correctly I think problem is in "gentoo way". Revert from snapshot (thanks to virtualization :-))) and: 1) set gcc 4.1.2 (with gcc-config) and manually ebuild kdelibs-4.1.87.ebuild compile libplasma has no symbol (thus is not correct) 2) set gcc 4.3.2 (with gcc-config) and manually ebuild kdelibs-4.1.87.ebuild compile libplasma has symbol (is correct) Mmmmmm.... I look in portage... what change from 2 day ago? I found: -rw-r--r-- 1 portage portage 1757 Aug 19 20:37 gcc-4.3.1-r1.ebuild -rw-r--r-- 1 portage portage 1748 Jun 29 2008 gcc-4.3.1.ebuild -rw-r--r-- 1 root root 2191 Jan 2 21:37 gcc-4.3.2-r2.ebuild -rw-r--r-- 1 root root 1830 Dec 29 11:06 gcc-4.3.2.ebuild At this moment I think gcc-4.3.2.ebuild dated dec 29 is the problem. ... reverting and recompiling... Stay tuned :-)) emerged gcc-4.3.2.ebuild dated dec 29. kdelibs build correct... ...now I am confusing. In this moment I am not able to reproduce error. Tomorrow I check again... Logos manuel # cd /usr/kde/4.2/lib64/ Logos lib64 # strings libplasma.so | c++filt | grep Plasma::Containment::StyleOption Logos lib64 # cd /home/kde-devel/kde/lib/ Logos lib # strings libplasma.so | c++filt | grep Plasma::Containment::StyleOption Logos lib # After that I added PLASMA_EXPORT and tadaaa: Logos lib # cd /home/kde-devel/kde/lib/ Logos lib # strings libplasma.so | c++filt | grep Plasma::Containment::StyleOption Plasma::Containment::StyleOption::StyleOption(QStyleOptionGraphicsItem const&) Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&) Plasma::Containment::StyleOption::StyleOption() Plasma::Containment::StyleOption::StyleOption() Plasma::Containment::StyleOption::StyleOption(QStyleOptionGraphicsItem const&) Plasma::Containment::StyleOption::StyleOption(Plasma::Containment::StyleOption const&) Logos lib # So please add it at least to trunk. *** This bug has been confirmed by popular vote. *** SVN commit 906246 by sedwards: BUG: 178354 StyleOption isn't being exported correctly on some versions of gcc. M +1 -1 containment.h WebSVN link: http://websvn.kde.org/?view=rev&revision=906246 |