Здравствуйте.
Скажите пожалуйста какие пакеты нужно установить, что бы можно было кодить на Kdevelop?
Я новичёк в программировании под линукс!!!
вот простейшая демо программка из Kdevelop:
#include "kdeapl.h"
#include <qlabel.h>
#include <kmainwindow.h>
#include <klocale.h>
kdeapl::kdeapl()
: KMainWindow( 0, "kdeapl" )
{
// set the shell's ui resource file
setXMLFile("kdeaplui.rc");
new QLabel( "Hello World", this, "hello label" );
}
kdeapl::~kdeapl()
{
}
#include "kdeapl.moc"
gcc kdeapl.cpp -o kdeapl
In file included from kdeapl.cpp:22:
kdeapl.h:29:25: error: kmainwindow.h: No such file or directory
kdeapl.cpp:24:20: error: qlabel.h: No such file or directory
kdeapl.cpp:27:21: error: klocale.h: No such file or directory
kdeapl.cpp:42:22: error: kdeapl.moc: No such file or directory
In file included from kdeapl.cpp:22:
kdeapl.h:37: error: expected class-name before ‘{’ token
kdeapl.h:38: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
kdeapl.h:39: error: expected ‘;’ before ‘public’
kdeapl.cpp:29: error: definition of implicitly-declared ‘kdeapl::kdeapl()’
kdeapl.cpp:29: error: declaration of ‘kdeapl::kdeapl()’ throws different exceptions
kdeapl.h:37: error: from previous declaration ‘kdeapl::kdeapl() throw ()’
kdeapl.cpp: In constructor ‘kdeapl::kdeapl()’:
kdeapl.cpp:30: error: class ‘kdeapl’ does not have any field named ‘KMainWindow’
kdeapl.cpp:33: error: ‘setXMLFile’ was not declared in this scope
kdeapl.cpp:35: error: expected type-specifier before ‘QLabel’
kdeapl.cpp:35: error: expected `;' before ‘QLabel’
Пробовал скомпилить паскалевское приложение :
program paskapl;
{$mode objfpc}
uses
glib,gdk,gtk;
procedure hello(widget : pGtkWidget ; data: pgpointer ); cdecl;
begin
writeln('Hello World');
end;
function delete_event (widget : pGtkWidget ; event: pGdkEvent; data: pgpointer ): integer; cdecl;
begin
writeln('Delete Event Occurred');
delete_event := ord(true);
end;
procedure destroy(widget : pGtkWidget ; data: pgpointer ); cdecl;
begin
gtk_main_quit();
end;
var
window, button : pGtkWidget;//GtkWidget is the storage type for widgets
begin
// This is called in all GTK applications. Arguments are parsed
// from the command line and are returned to the application.
gtk_init (@argc, @argv);
// create a new window
window := gtk_window_new (GTK_WINDOW_TOPLEVEL);
// When the window is given the "delete_event" signal (this is given
// by the window manager, usually by the 'close' option, or on the
// titlebar), we ask it to call the delete_event () function
// as defined above. The data passed to the callback
// function is NULL and is ignored in the callback function.
gtk_signal_connect (pGTKOBJECT (window), 'delete_event',
GTK_SIGNAL_FUNC (@delete_event), NIL);
// Here we connect the "destroy" event to a signal handler.
// This event occurs when we call gtk_widget_destroy() on the window,
// or if we return 'FALSE' in the "delete_event" callback.
gtk_signal_connect (pGTKOBJECT (window), 'destroy',
GTK_SIGNAL_FUNC (@destroy), NULL);
// Sets the border width of the window.
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
// Creates a new button with the label "Hello World".
button := gtk_button_new_with_label ('Hello_World');
// When the button receives the "clicked" signal, it will call the
// function hello() passing it NULL as its argument. The hello()
// function is defined above. */
gtk_signal_connect (pGTKOBJECT (button), 'clicked',
GTK_SIGNAL_FUNC (@hello), NULL);
// This will cause the window to be destroyed by calling
// gtk_widget_destroy(window) when "clicked". Again, the destroy
// signal could come from here, or the window manager
gtk_signal_connect_object (pGTKOBJECT (button), 'clicked',
GTK_SIGNAL_FUNC (@gtk_widget_destroy),
pGTKOBJECT(window));
// This packs the button into the window (a gtk container).
gtk_container_add (GTK_CONTAINER (window), button);
// The final step is to display this newly created widget.
gtk_widget_show (button);
// and the window
gtk_widget_show (window);
// All GTK applications must have a gtk_main(). Control ends here
// and waits for an event to occur (like a key press or
// mouse event).
gtk_main ();
end.
fpc paskapl.pp
Free Pascal Compiler version 2.2.0 [2008/04/01] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling paskapl.pp
paskapl.pp(6,14) Fatal: Can't find unit glib used by paskapl
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
Подскажите что нужно? спасибо!