This forum has been archived. All content is frozen. Please use KDE Discuss instead.

related libraries

Tags: plasma plasma plasma
(comma "," separated)
User avatar
soulless
Posts
9
Karma
0

related libraries

Tue Jul 20, 2010 4:29 pm
I wrote a short code to test combination of Qt and plasma.

I just used this code in my Qt widget:

Code: Select all
Plasma::WindowEffects::overrideShadow(winId(), true);


I received linker error: (I'm not developing a plasma applet. just wanna use plasma API's on my Qt program)

undefined reference to Plasma::WindowEffects::overrideShadow(unsigned long, bool);


I (searched and) couldn't find which library I should use. And even couldn't find s.th like "related libraries" on KDE TechBase. any help!?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: related libraries

Wed Jul 21, 2010 4:57 am
Plasma functions are contained in libplasma, which is a component of kdelibs. In particular, you need to link aganist libplasma.so.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
soulless
Posts
9
Karma
0

Re: related libraries

Thu Jul 22, 2010 8:09 am
oh really thanks man! Today I test it and it solved the linkage problem with plasma. but now there's another error that I have no idea about:

/usr/lib/libkdeui.so.5: undefined reference to `QString::isRightToLeft() const'
/usr/lib/libkdeui.so.5: undefined reference to `QIcon::name() const'


I'm using Qt 4.7-snapshot and KDE 4.5 rc2
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: related libraries

Fri Jul 23, 2010 6:40 am
Unusual issue. Make sure you are linking to QtCore and QtGui.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ivan
KDE Developer
Posts
918
Karma
14
OS

Re: related libraries

Fri Jul 23, 2010 7:22 am
soulless

How are you compiling?


Image
User avatar
soulless
Posts
9
Karma
0

Re: related libraries

Fri Jul 23, 2010 8:32 am
I'm using Qt Creator (I press run and it compile the project..) and created a new Qt GUI project on that.
( I just wanna test EnableBlurBehind() on my very basic QWidget )
User avatar
ivan
KDE Developer
Posts
918
Karma
14
OS

Re: related libraries

Fri Jul 23, 2010 8:53 am
Ok, that is strange - QtC should create a valid makefiles.

You can try manually invoking 'run qmake' (I don't remember in what menu exactly it is) and you should check whether .pro file is valid. (you could also post it here)


Image
User avatar
soulless
Posts
9
Karma
0

Re: related libraries

Fri Jul 23, 2010 1:03 pm
here's my main file that use the plasma:

Code: Select all
#include <QtGui/QApplication>
#include "widget.h"
#include <KDE/Plasma/WindowEffects>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    Plasma::WindowEffects::enableBlurBehind(w.winId(), true);
    w.show();
    return a.exec();
}


and here's my pro file:

Code: Select all
QT       += core gui

TARGET = blurtest
TEMPLATE = app


SOURCES += main.cpp\
        widget.cpp

HEADERS  += widget.h

FORMS    += widget.ui

LIBS += -L/usr/lib -lplasma
User avatar
ivan
KDE Developer
Posts
918
Karma
14
OS

Re: related libraries

Fri Jul 23, 2010 1:14 pm
Ok, it looks like QtCreator is trying to link to an older version of Qt (4.6 or earlier)


Image
User avatar
soulless
Posts
9
Karma
0

Re: related libraries

Fri Jul 23, 2010 4:10 pm
I'm almost sure that there's no Qt older than 4.6.2 version installed on my computer!
User avatar
ivan
KDE Developer
Posts
918
Karma
14
OS

Re: related libraries  Topic is solved

Fri Jul 23, 2010 4:25 pm
I misspelled - 4.6.x or earlier - so it is trying to link to them while kdelibs are compiled with 4.7.

QString::isRightToLeft() and QIcon::name() are introduced in 4.7.


Image
User avatar
soulless
Posts
9
Karma
0

Re: related libraries

Sat Jul 24, 2010 9:14 pm
I was using 4.7beta1 then changed it to beta 2 and now everything works fine. Really thanks to both of you :)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]