Description: This is a very simple template for KDE applications.
By very simple I mean not only is it very simple to use, but it's appropriate pretty much only for simple KDE applications. :-(
Basically, it includes a Makefile, a sample .ui file and implementation, and a file that creates the KApplication and sample widget for you.
The Makefile handles the following for you:
* Automatic dependency tracking (it's what the hidden .d files are). This also means that .moc files should be generated before any file that #includes them is built, and .cpp and .h files are generated from .ui files as necessary. * Automatic .ui detection. What this means is that if you don't specify otherwise, the Makefile will assume all .ui files in the current directory are necessary for the program. * Automatically generates moc files for .ui files. * Makefile includes install and uninstall targets, which do nothing more than install and remove the target from the KDE binary directory.
Note that since it is just a Makefile, the template has a few limitations. .h and .cpp files generated from .ui files will have the same basename (foo.ui => foo.h and foo.cpp), and likewise for .moc files (foo.h => foo.moc, foo.cpp depends on foo.moc). I don't think this is really a problem in practice though.
Also, the Makefile is *very* dependant on the GNU version of make (if you don't know what I'm talking about, you probably have GNU make).
Indeed, I would ask you to use this template for your development *ONLY*, and then convert to autotools or qmake for release for portability reasons. Not to mention that autotools-based KDE build system includes support for niceties as documentation and translation support, icon handling, building of libraries instead of apps, and other fun things that I haven't done.
On second thought, the only reason I'm submitting this instead of having you use qmake is because of the rather quiet output ;-)Last changelog:
0.4: Initial release. Builds, installs, and uninstalls programs, but doesn't handle much else.
Ther is a problem while compaling this program under suse Linux 9.1 Pro 64bit.
jasmin@jasmin:~/public_html/c_c++/kde3/kdeapptemplate-0.4> make
Generating mainwidget.moc
Generating mainwidgetbase.h
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: CPU you selected does not support x86-64 instruction set
Generating mainwidgetbase.cpp
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: CPU you selected does not support x86-64 instruction set
Compiling mainwidgetbase.o
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: CPU you selected does not support x86-64 instruction set
make: *** [mainwidgetbase.o] Erreur 1
When i changed Makefile :
- Put CPU=i386 in comment
- and CXXFLAGS = -g -pipe -Wall,
i got this :
jasmin@jasmin:~/public_html/c_c++/kde3/kdeapptemplate-0.4> make
Compiling mainwidgetbase.o
Compiling kdeapp.o
Compiling mainwidget.o
Compiling mainwidgetbase_moc.o
Linking kdeapp
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/bin/ld: escamotage incompatible /usr/lib/qt3/lib/libqt-mt.so lors de la recherche de -lqt-mt
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/bin/ld: ne peut trouver -lqt-mt
collect2: ld returned 1 exit status
make: *** [kdeapp] Erreur 1
So i did this :
g++ -o kdeapp -L/usr/lib/qt3/lib64 -L/opt/kde3/lib64 kdeapp.o mainwidget.o mainwidgetbase.o mainwidgetbase_moc.o -lkdeui
Ratings & Comments
1 Comment
Ther is a problem while compaling this program under suse Linux 9.1 Pro 64bit. jasmin@jasmin:~/public_html/c_c++/kde3/kdeapptemplate-0.4> make Generating mainwidget.moc Generating mainwidgetbase.h cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: CPU you selected does not support x86-64 instruction set Generating mainwidgetbase.cpp cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: CPU you selected does not support x86-64 instruction set Compiling mainwidgetbase.o cc1plus: error: CPU you selected does not support x86-64 instruction set cc1plus: error: CPU you selected does not support x86-64 instruction set make: *** [mainwidgetbase.o] Erreur 1 When i changed Makefile : - Put CPU=i386 in comment - and CXXFLAGS = -g -pipe -Wall, i got this : jasmin@jasmin:~/public_html/c_c++/kde3/kdeapptemplate-0.4> make Compiling mainwidgetbase.o Compiling kdeapp.o Compiling mainwidget.o Compiling mainwidgetbase_moc.o Linking kdeapp /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/bin/ld: escamotage incompatible /usr/lib/qt3/lib/libqt-mt.so lors de la recherche de -lqt-mt /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/bin/ld: ne peut trouver -lqt-mt collect2: ld returned 1 exit status make: *** [kdeapp] Erreur 1 So i did this : g++ -o kdeapp -L/usr/lib/qt3/lib64 -L/opt/kde3/lib64 kdeapp.o mainwidget.o mainwidgetbase.o mainwidgetbase_moc.o -lkdeui