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

CMake won't compile "Hello World"

Tags: None
(comma "," separated)
MiceAreVeryNice
Registered Member
Posts
15
Karma
0
OS

CMake won't compile "Hello World"

Fri Mar 21, 2014 6:06 pm
I tried to compile the "Hello World" file from Tutorial 1, with the provided CMakeLists, but at halfway, CMake throws bugs in my face!
Here is the trace:
Code: Select all
/home/asd/Hello/main.cpp: In function ‘int main(int, char**)’:
/home/asd/Hello/main.cpp:30:38: error: no matching function for call to ‘KAboutData::KAboutData(const char [10], int, KLocalizedString, const char [4], KLocalizedString, KLocalizedString, KLocalizedString, const char [19], const char [20])’
/home/asd/Hello/main.cpp:30:38: note: candidates are:
In file included from /usr/include/KDE/KAboutData:1:0,
                 from /home/asd/Hello/main.cpp:4:
/usr/include/KDE/../kaboutdata.h:282:6: note: KAboutData::KAboutData(const KAboutData&)
/usr/include/KDE/../kaboutdata.h:282:6: note:   candidate expects 1 argument, 9 provided
/usr/include/KDE/../kaboutdata.h:266:5: note: KAboutData::KAboutData(const QByteArray&, const QByteArray&, const KLocalizedString&, const QByteArray&, const KLocalizedString&, KAboutData::LicenseKey, const KLocalizedString&, const KLocalizedString&, const QByteArray&, const QByteArray&)
/usr/include/KDE/../kaboutdata.h:266:5: note:   no known conversion for argument 6 from ‘KLocalizedString’ to ‘KAboutData::LicenseKey’
/home/asd/Hello/main.cpp:36:64: error: no matching function for call to ‘KGuiItem::KGuiItem(KLocalizedString, QString, KLocalizedString, KLocalizedString)’
/home/asd/Hello/main.cpp:36:64: note: candidates are:
In file included from /usr/include/KDE/../kmessagebox.h:27:0,
                 from /usr/include/KDE/KMessageBox:1,
                 from /home/asd/Hello/main.cpp:6:
/usr/include/kguiitem.h:54:5: note: KGuiItem::KGuiItem(const KGuiItem&)
/usr/include/kguiitem.h:54:5: note:   candidate expects 1 argument, 4 provided
/usr/include/kguiitem.h:50:5: note: KGuiItem::KGuiItem(const QString&, const KIcon&, const QString&, const QString&)
/usr/include/kguiitem.h:50:5: note:   no known conversion for argument 1 from ‘KLocalizedString’ to ‘const QString&’
/usr/include/kguiitem.h:45:14: note: KGuiItem::KGuiItem(const QString&, const QString&, const QString&, const QString&)
/usr/include/kguiitem.h:45:14: note:   no known conversion for argument 1 from ‘KLocalizedString’ to ‘const QString&’
/usr/include/kguiitem.h:39:5: note: KGuiItem::KGuiItem()
/usr/include/kguiitem.h:39:5: note:   candidate expects 0 arguments, 4 provided                                     
/home/asd/Hello/main.cpp:38:90: error: ‘(KMessageBox::DialogType)1u’ cannot be used as a function                 
make[2]: *** [CMakeFiles/tutorial1.dir/main.o] Error 1                                                               
make[1]: *** [CMakeFiles/tutorial1.dir/all] Error 2
make: *** [all] Error 2

I use KDE 4.8.4. What could have gone wrong?


Squeak squeak
Why would you oxygenize your desktop if there is cheese?
Cheese Desktop Environment for KDE downloads:
Cursor theme UPDATED!
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Is this KDevelop's template? It probably sucks. But, which template did you use exactly and from what version of KDevelop? KDE 4.8 is quite old.
Try this: http://techbase.kde.org/Development/Tut ... st_program

Somebody is working on improving the templates already ;)


I'm working on the KDevelop IDE.
MiceAreVeryNice
Registered Member
Posts
15
Karma
0
OS
No, I copypasted it from the tutorial site. And the main.cpp was made in Qt4 Creator.
EDIT: copypaste and Qt Creator caused the bug.

Last edited by MiceAreVeryNice on Fri Mar 21, 2014 8:36 pm, edited 1 time in total.


Squeak squeak
Why would you oxygenize your desktop if there is cheese?
Cheese Desktop Environment for KDE downloads:
Cursor theme UPDATED!
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Ok, in that case try the kdevelop template instead and if that works, fix the tutorial page. ;)


I'm working on the KDevelop IDE.
MiceAreVeryNice
Registered Member
Posts
15
Karma
0
OS
I compiled it with KDevelop with the modified CMake file, but the app still won't show up.
EDIT: success.


Squeak squeak
Why would you oxygenize your desktop if there is cheese?
Cheese Desktop Environment for KDE downloads:
Cursor theme UPDATED!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If this issue has been solved, can you please mark the appropriate response as solving the issue? Thanks.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]