![]() Registered Member ![]()
|
Hello,
I try to write my first plasmoid but I'm stuck with building it. You can see the code here. For some reason it tells me that thread is not a type when I try declare a object of type thread in plasmoid.hpp. I don't understand the way Qt's buildsystem so far, hence I have no idea how I can fix that problem. Could somebody tell me how I can build this code, please? P.S.: the imap class in imap.hpp isn't important and can be ignored for testing.
Last edited by far_away on Sun Jan 18, 2009 7:57 pm, edited 1 time in total.
|
![]() KDE Developer ![]()
|
OK, it would help if you paste the compile errors here.
But anyway, you get the error there, that it doesn't know thread ? thread *thrd = new thread (); It seems you are missing an include thread.hpp or what ever it is called in your plasmoid.cpp.
DanielW, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Where do I miss it? I don't know what the problem is since I am including "thread.hpp" in "plasmoid.hpp" which is included in "plamoid.cpp". It doesn't make any difference whether I include thread.hpp or thread.moc. Anyway, here is the compiler output.
My cmakelist.txt is
There is another annoying thing I noticed: when I try to use std::exceptions in my plasmoid it tells me that exceptions are disabled and that I should the -fexceptions command. Where do I have to enter it? Thanks for your help! |
![]() KDE Developer ![]()
|
Well in your linked source (which is quite hard to read) you are including thread.moc. I think it should be thread.hpp. You have "// **** Plasmoid.hpp" but you inculde "plasmoid.hpp" Only a error in your paste? Well, I am lost now. It would really help if you could upload your complete source with CMakeList.txt somewhere (or mail it to me ).
Well -fno-exceptions is default in parts of KDE, as far as I know for performance reasons. I do not really know if you can savely use -fexceptions and worse: I do not know how to set it. Somewhere in your CMakeList you should be able to set compiler switches.
DanielW, proud to be a member of KDE forums since 2008-Oct.
|
![]() KDE Developer ![]()
|
In your CMakeLists.txt, before declaring what needs exceptions, add:
Pino Toscano
|
![]() Registered Member ![]()
|
Okay, you can download it from here. Thanks! |
![]() KDE Developer ![]()
|
Ok, got it to compile. (For some reason it doesn't work with the class name thread.. Works with "threadu" not sure why) and link. There are sme other changes too. So best you diff it with your source to see all changes. But it crashes plasma. Didn't look further into it (do not know much about the plasma api anyway). You download the "fixed" version here: http://arch4.der-winti.de/kde/bla.tar.gz
DanielW, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell