PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Komoilieren von GTK2-Programmen funktioniert nicht



LinuxTeddy
21.06.04, 06:01
Hi!

Wann immer ich versuche,ein Programm zu kompilieren,welches GTK2 benötigt,wird make mit dem Hinweis abgebrochen,daß GTK2 nicht installiert sei.
Dabei sind alle GTK2-Pakete(also auch die devel-Pakete) installiert.
Auch bei Programmen,die wxgtk benötigen,wid behauptet,dieses sei nicht installiert.

Woran kann das liegen?

Heinz

Jigsore
21.06.04, 06:29
Vielleicht hilfts das einfache GTK-Devel auch zu installieren?

LinuxTeddy
21.06.04, 07:22
Ist installiert.
Das kann es also nicht sein.

CEROG
21.06.04, 16:25
Hallo LinuxTeddy,

die Frage ist, wo die gtk2-Pakete installiert sind.

Vermutlich liegen sie in /usr/ und wxgtk sucht sie unter /usr/local (oder umgekehrt).

Überprüf das bitte mal.

Es gibt ein Verzeichnis /pkgconfig, in welches bei der Installation von gtk2-Programmen geschaut wird. Hier mußt du mit


echo PKG_CONFIG_PATH=/Pfad/zu/lib/pkgconfig

die entsprechende Systemvariable setzen.

Dann sollte es funktionieren.

Viele Grüße,

CEROG

LinuxTeddy
21.06.04, 17:30
danke,das war's

aber jetzt wirft xmule bei make andere Fehler aus...:

/usr/include/wx/font.h:82: error: Syntaxfehler before `{' token
/usr/include/wx/font.h:104: error: non-member function `bool Ok()' cannot have
`const' method qualifier
/usr/include/wx/font.h: In function `bool Ok()':
/usr/include/wx/font.h:104: error: `m_refData' undeclared (first use this
function)
/usr/include/wx/font.h:104: error: (Each undeclared identifier is reported only
once for each function it appears in.)
/usr/include/wx/font.h: At global scope:
/usr/include/wx/font.h:107: error: non-member function `bool operator==(const
wxFont&)' cannot have `const' method qualifier
/usr/include/wx/font.h:107: error: `bool operator==(const wxFont&)' must take
exactly two arguments
/usr/include/wx/font.h:108: error: non-member function `bool operator!=(const
wxFont&)' cannot have `const' method qualifier
/usr/include/wx/font.h:108: error: `bool operator!=(const wxFont&)' must take
exactly two arguments
/usr/include/wx/font.h:111: error: virtual outside class declaration
/usr/include/wx/font.h:111: error: non-member function `int GetPointSize()'
cannot have `const' method qualifier
/usr/include/wx/font.h:111: error: function `int GetPointSize()' is initialized
like a variable
/usr/include/wx/font.h:112: error: virtual outside class declaration
/usr/include/wx/font.h:112: error: non-member function `int GetFamily()' cannot
have `const' method qualifier
/usr/include/wx/font.h:112: error: function `int GetFamily()' is initialized
like a variable
/usr/include/wx/font.h:113: error: virtual outside class declaration
/usr/include/wx/font.h:113: error: non-member function `int GetStyle()' cannot
have `const' method qualifier
/usr/include/wx/font.h:113: error: function `int GetStyle()' is initialized
like a variable
/usr/include/wx/font.h:114: error: virtual outside class declaration
/usr/include/wx/font.h:114: error: non-member function `int GetWeight()' cannot
have `const' method qualifier
/usr/include/wx/font.h:114: error: function `int GetWeight()' is initialized
like a variable
/usr/include/wx/font.h:115: error: virtual outside class declaration
/usr/include/wx/font.h:115: error: non-member function `bool GetUnderlined()'
cannot have `const' method qualifier
/usr/include/wx/font.h:115: error: function `bool GetUnderlined()' is
initialized like a variable
/usr/include/wx/font.h:116: error: virtual outside class declaration
/usr/include/wx/font.h:116: error: non-member function `wxString GetFaceName()'
cannot have `const' method qualifier
/usr/include/wx/font.h:116: error: function `wxString GetFaceName()' is
initialized like a variable
/usr/include/wx/font.h:117: error: virtual outside class declaration
/usr/include/wx/font.h:117: error: non-member function `wxFontEncoding
GetEncoding()' cannot have `const' method qualifier
/usr/include/wx/font.h:117: error: function `wxFontEncoding GetEncoding()' is
initialized like a variable
/usr/include/wx/font.h:118: error: virtual outside class declaration
/usr/include/wx/font.h:118: error: non-member function `wxNativeFontInfo*
GetNativeFontInfo()' cannot have `const' method qualifier
/usr/include/wx/font.h:120: error: virtual outside class declaration
/usr/include/wx/font.h:120: error: non-member function `bool IsFixedWidth()'
cannot have `const' method qualifier
/usr/include/wx/font.h:122: error: non-member function `wxString
GetNativeFontInfoDesc()' cannot have `const' method qualifier
/usr/include/wx/font.h:123: error: non-member function `wxString
GetNativeFontInfoUserDesc()' cannot have `const' method qualifier
/usr/include/wx/font.h:126: error: virtual outside class declaration
/usr/include/wx/font.h:126: error: function `void SetPointSize(int)' is
initialized like a variable
/usr/include/wx/font.h:127: error: virtual outside class declaration
/usr/include/wx/font.h:127: error: function `void SetFamily(int)' is
initialized like a variable
/usr/include/wx/font.h:128: error: virtual outside class declaration
/usr/include/wx/font.h:128: error: function `void SetStyle(int)' is initialized
like a variable
/usr/include/wx/font.h:129: error: virtual outside class declaration
/usr/include/wx/font.h:129: error: function `void SetWeight(int)' is
initialized like a variable
/usr/include/wx/font.h:130: error: virtual outside class declaration
/usr/include/wx/font.h:130: error: function `void SetFaceName(const wxString&)'
is initialized like a variable
/usr/include/wx/font.h:131: error: virtual outside class declaration
/usr/include/wx/font.h:131: error: function `void SetUnderlined(bool)' is
initialized like a variable
/usr/include/wx/font.h:132: error: virtual outside class declaration
/usr/include/wx/font.h:132: error: function `void SetEncoding(wxFontEncoding)'
is initialized like a variable
/usr/include/wx/font.h:133: error: virtual outside class declaration
/usr/include/wx/font.h:140: error: non-member function `wxString
GetFamilyString()' cannot have `const' method qualifier
/usr/include/wx/font.h:141: error: non-member function `wxString
GetStyleString()' cannot have `const' method qualifier
/usr/include/wx/font.h:142: error: non-member function `wxString
GetWeightString()' cannot have `const' method qualifier
/usr/include/wx/font.h:145: error: virtual outside class declaration
/usr/include/wx/font.h:146: error: virtual outside class declaration
/usr/include/wx/font.h: In function `wxFontEncoding GetDefaultEncoding()':
/usr/include/wx/font.h:150: error: `ms_encodingDefault' undeclared (first use
this function)
/usr/include/wx/font.h: At global scope:
/usr/include/wx/font.h:153: error: Syntaxfehler before `protected'
xh_bmpbt.cpp: In constructor `
wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler ()':
xh_bmpbt.cpp:28: error: `wxBU_AUTODRAW' undeclared (first use this function)
xh_bmpbt.cpp:29: error: `wxBU_LEFT' undeclared (first use this function)
xh_bmpbt.cpp:30: error: `wxBU_RIGHT' undeclared (first use this function)
xh_bmpbt.cpp:31: error: `wxBU_TOP' undeclared (first use this function)
xh_bmpbt.cpp:32: error: `wxBU_BOTTOM' undeclared (first use this function)
xh_bmpbt.cpp: In member function `virtual wxObject*
wxBitmapButtonXmlHandler::DoCreateResource()':
xh_bmpbt.cpp:38: error: `wxBitmapButton' undeclared (first use this function)
xh_bmpbt.cpp:38: error: `button' undeclared (first use this function)
xh_bmpbt.cpp:38: error: Syntaxfehler before `)' token
xh_bmpbt.cpp:38: error: Syntaxfehler before `;' token
xh_bmpbt.cpp:42: error: invalid use of undefined type `struct wxBitmap'
/usr/include/wx/gdicmn.h:35: error: forward declaration of `struct wxBitmap'
xh_bmpbt.cpp:45: error: `wxDefaultValidator' undeclared (first use this
function)
xh_bmpbt.cpp:52: error: invalid use of undefined type `struct wxBitmap'
/usr/include/wx/gdicmn.h:35: error: forward declaration of `struct wxBitmap'
xh_bmpbt.cpp:54: error: invalid use of undefined type `struct wxBitmap'
/usr/include/wx/gdicmn.h:35: error: forward declaration of `struct wxBitmap'
xh_bmpbt.cpp:56: error: invalid use of undefined type `struct wxBitmap'
/usr/include/wx/gdicmn.h:35: error: forward declaration of `struct wxBitmap'
make[2]: *** [xh_bmpbt.o] Fehler 1
make[2]: Leaving directory `/home/heinz/Downloads/xmule-1.8.2c/src/wx/xrc'
make[1]: *** [libxrc] Fehler 2
make[1]: Leaving directory `/home/heinz/Downloads/xmule-1.8.2c/src'
make: *** [all] Fehler 2

:-(

CEROG
21.06.04, 18:02
Hallo LinuxTeddy,

hier kann ich dir leider nicht weiterhelfen.

Viele Grüße,

CEROG

derguteweka
21.06.04, 18:17
Moin,

@LinuxTeddy: Bei deiner geposteten Fehlermeldung bin ich mir ziemlich sicher, dass die erste Zeile:
/usr/include/wx/font.h:82: error: Syntaxfehler before `{' token

nicht die erste Zeile ist mit Fehlermeldungen.
Da sind wahrscheinlich vorher noch Fehlermeldungen, evtl. sowas wie:
irgendwas.h: No such file or directory
Kannste mal gucken ?

Gruss
WK

LinuxTeddy
21.06.04, 18:23
Naja,da steht ja etwas von font.h...

Aber hier der Bereich darüber:

Compiling wx/xrc/xmlrole.c...
Compiling wx/xrc/xmltok.c...
Compiling wx/xrc/xmlparse.c...
Compiling wx/xrc/xh_bmpbt.cpp...
In file included from /usr/include/wx/gdicmn.h:29,
from ../../wx/xrc/xmlres.h:23,
from ../../wx/xrc/xh_bmpbt.h:18,
from xh_bmpbt.cpp:22:

derguteweka
21.06.04, 21:05
Moin,

Weia, das ist nicht besonders erhellend. Der Fehler scheint ja dann nur in den include-Dateien von wxGTK zu sein. Da fehlt mir auch die zuendende Idee. Hoechstens nochmal komplett loeschen und ein erneutes configure drueberlaufen lassen. Das ist ja am Anfang bei dir ausgestiegen. Evtl. war dann schon was falsch konfiguriert. Ist aber imho nicht sehr wahrscheinlich, bloss faellt mir sonst erstmal nix ein.

Gruss
WK

Strangerli
18.11.04, 18:42
Tja, bei mir sieht das ganze noch hoffnungsloser aus. Ich habe, da ich schon vorher Probleme mit gtk2 hatte, mich diesmal an die FAQ und an dem Beispiel der GTK-Homepage gehalten. In dem Beispiel wird GTK2 in den Ordner /opt installiert, nachdem man es kompiliert hat. Soweit so gut.

PKG_CONFIG_PATH, LIBDIR, CPPFLAGS und die anderen Variablen gesetzt und dennoch kann ich kein GTK2 Programm kompilieren. In der FAQ gab es noch Tipps an was es liegen könnte, daß GTK2 nicht erkannt wird, aber diese halfen leider auch nicht.

-----

pkg-config gtk+-2.0 --modversion
2.2.4

------

pkg-config --list-all
pango Pango - Internationalized text handling
glib-2.0 GLib - C Utility Library
imlib Imlib - An image loading and rendering library for X11R6
libexif libexif - Library for easy access to EXIF data
avifile avifile - A library for reading and writing of compressed video
gdk-pixbuf-xlib-2.0 GdkPixbuf Xlib - GdkPixbuf rendering for Xlib
libxslt libxslt - XSLT library version 2.
libexif-gtk libexif-gtk - GTK-widgets for libexif
gtk+ GTK+ - GIMP Tool Kit
gobject-2.0 GObject - GLib Type, Object, Parameter and Signal Library
glib GLib - C Utility Library
gmodule-2.0 GModule - Dynamic module loader for GLib
esound esound - esound
atk Atk - Accessibility Toolkit
libart-2.0 libart - LGPL version of the libart library
libxml-2.0 libXML - libXML library version2.
gdk-x11-2.0 GDK - GIMP Drawing Kit (x11 target)
libgphoto2 libgphoto2 - Library for easy access to digital cameras
gmodule GModule - Dynamic module loader for GLib
imlibgdk ImlibGdk - GDK support libraries for Imlib
gdk-2.0 GDK - GIMP Drawing Kit (x11 target)
gthread-2.0 GThread - Thread support for GLib
freetype2 FreeType 2 - A free, high-quality, and portable font engine.
audiofile audiofile - audiofile
pangox Pango X - X Window System font support for Pango
gtk+-2.0 GTK+ - GIMP Tool Kit (x11 target)
gtk+-x11-2.0 GTK+ - GIMP Tool Kit (x11 target)
alsa alsa - Advanced Linux Sound Architecture (ALSA) - Library
gthread GThread - Thread support for GLib
gdk-pixbuf-2.0 GdkPixbuf - Image loading and scaling
libgift libgift - libgift
libxine libxine - The xine engine library
gdk GDK - GIMP Drawing Kit

----

Aber dennoch kommt bei gimp2 und gaim 1.0.3

checking for pkg-config... (cached) /usr/local/bin/pkg-config
checking for GLIB - version >= 2.0.0... yes (version 2.4.0)
checking for pkg-config... (cached) /usr/local/bin/pkg-config
checking for GTK+ - version >= 2.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding GTK+ or finding the wrong
*** version of GTK+. If it is not finding GTK+, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
configure: error:
*** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+
*** development headers installed. The latest version of GTK+ is
*** always available at http://www.gtk.org/.



Ich hab keine Lust mir eine neue Suse Version zu installieren, weil das eher ein Davonlaufen als ein Lösen des Problems ist. Nur gehen mir langsam die Optionen aus. :(

CEROG
18.11.04, 19:11
Hallo Strangerli,

ich kompiliere gtk+-2.x immer nach der Anleitung (http://linux.cad.de/umstieg/install/gtk2_install.shtml) auf der Inoffiziellen Linux-Hilfeseite (http://linux.cad.de) und habe damit keine Probleme, wenn die Variable PKG_CONFIG_PATH gesetzt ist. Die muß ich bei Gelegenheit mal in mein Profil eintragen . :)

Hier auf der Plattform gibt unter der URL
http://www.linuxforen.de/forums/showthread.php?t=44816 (http://www.linuxforen.de/forums/showthread.php?t=44816) eine ähnliche Anleitung.

Noch ein Tipp: Manchmal hilft auch ein einfaches "ldconfig" aus.

Viele Grüße,

CEROG

Strangerli
18.11.04, 19:22
ldconfig hab ich schon oft ausgeführt, ld.so.conf oft bearbeitet, aber pkgconfig habe ich mir noch keine neue Version geholt. Vielleicht löst das ja meine Probleme.

CEROG
19.11.04, 03:59
Hallo Strangerli,

die Neuinstallation von pkg-config wird dir nichts bringen. Würde die Version nicht passen, so hätte schon das configure-Script der glib-2 gemeckert.

Du solltest glib, pango, atk und gtk nach einer der beiden angegebenen Anleitungen installieren. Wie gesagt, ich mache es so wie bei der auf der Linux-Hilfeseite. Funktioniert.

Viele Grüße,

CEROG

Strangerli
22.11.04, 19:11
Ich habe mal die config.log von dem Versuch gaim zu kompilieren beigefügt. Vielleicht könnt ihr erkennen wieso gtk2 immer noch nicht erkannt wird.

Die Howtos haben es leider auch nicht getan. Obwohl alles von PKG-config gefunden wird, will er einfach keine GTK2 Programme kompilieren.

CEROG
22.11.04, 19:52
Hallo Srangerli,

ich will mal sehen, ob wir es hinbekommen.
In der config.log habe ich folgende Meldung gefunden:

configure:29243: error:
*** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+
*** development headers installed. The latest version of GTK+ is
*** always available at http://www.gtk.org/.

Als erstes habe ich ein paar Fragen :
1. Wie wurde gtk installiert? Als fertiges Binärpaket oder selbstkompiliert?
2. Wohin wurde gtk+-2.0 installiert?
3. Sind die Dateien gdk+-2.0.pc, gdk+-x11-2.0.pcgtk+-2.0.pc,und gtk+-x11-2.0.pc im lib/pkgconfig-Verzeichnis deines Installationsverzeichnisses?
4. Ist die Variable PKG_CONFIG_PATH gesetzt("echo $PKG_CONFIG_PATH"). Wenn ja, was enthält sie?
5. Wie sieht der Inhalt deines include/gtk+-2.0-Verzeichnisses im Installationsverzeichnis aus. sind dort die Header-Dateien wie gtk.h?

Auf diese Fragen brauche ich eine vollständigeAntwort, sonst sehe ich keine Möglichkeit, dir zu helfen.

Viele Grüße,

CEROG

Strangerli
22.11.04, 20:54
1. Wie wurde gtk installiert? Als fertiges Binärpaket oder selbstkompiliert?

Der 1er? das ist ein rpm gewesen.

2. Wohin wurde gtk+-2.0 installiert?

Ich hatte alle möglichen Orte wie z.B. /usr. Jetzt hab ich ihn wieder in /opt, wie man an der log erkennen kann.

3. Sind die Dateien gdk+-2.0.pc, gdk+-x11-2.0.pcgtk+-2.0.pc,und gtk+-x11-2.0.pc im lib/pkgconfig-Verzeichnis deines Installationsverzeichnisses?

-rw-r--r-- 1 root root 312 Nov 22 19:37 gdk-2.0.pc
-rw-r--r-- 1 root root 273 Nov 22 19:37 gdk-pixbuf-2.0.pc
-rw-r--r-- 1 root root 286 Nov 22 19:37 gdk-pixbuf-xlib-2.0.pc
-rw-r--r-- 1 root root 312 Nov 22 19:37 gdk-x11-2.0.pc
-rw-r--r-- 1 root root 335 Nov 22 19:37 gtk+-2.0.pc
-rw-r--r-- 1 root root 335 Nov 22 19:37 gtk+-x11-2.0.pc


4. Ist die Variable PKG_CONFIG_PATH gesetzt("echo $PKG_CONFIG_PATH"). Wenn ja, was enthält sie?

Also /opt/gtk2/lib/pkgconfig ist eingetragen, wenn du das meinst. Hab es auch in meine .profile Datei eigetragen, damit es immer drin steht.


5. Wie sieht der Inhalt deines include/gtk+-2.0-Verzeichnisses im Installationsverzeichnis aus. sind dort die Header-Dateien wie gtk.h?

Also in diesem Verzeichnis sind 4 Ordner:
rwxr-xr-x 2 root root 4096 Nov 22 19:37 gdk
drwxr-xr-x 2 root root 4096 Nov 22 19:37 gdk-pixbuf
drwxr-xr-x 2 root root 4096 Nov 22 19:37 gdk-pixbuf-xlib
drwxr-xr-x 2 root root 4096 Nov 22 19:37 gtk

Im gtk Ordner befinden sich ein Haufen Header Dateien inklusive gtk.h

CEROG
23.11.04, 04:25
Hallo Strangerli,

das sieht alles normal aus.

Gemeint war in der ersten Frage gtk+-2.0, nicht die 1er-Version. Aber du scheinst die Pakete aus den Quellen installiert zu haben.

Ich muß gestehen, daß ich nicht weiter weiß.

Ich tippe auf einen Fehler bei der Installation von gtk+-2.x, hab aber keine Möglichkeit da irgendetwas genaueres zu sagen.

Vielleicht versuchst du es ja noch mal, alle vier Pakete nach einer der beiden Beschreibungen zu installieren.

Sorry.

Viele Grüße,

CEROG

Strangerli
01.01.05, 12:20
Wollte euch nur mal Bescheid geben, das ich einen Rückschlag in Kauf genommen habe (im wahrsten Sinne des Wortes) und mir Suse 9.2 besorgt habe. Auf der einen Seite bin ich etwas enttäuscht, daß ich nun mehrere Schritte zurück gegangen bin, weil ich echt keine Lösungen mehr sah.

Auf der anderen Seite habe ich mich mit Suse 8.0 erst wirklich mit Linux beschäftigt und hatte von den Anfangszeiten her eine Menge Müll auf dem Rechner, den ich mit der Neuinstallation eines neuen Suse beseitigt habe. So kann ich von vorne anfangen ohne bei den kleineren Problemen stecken zu bleiben.

Für Debian halte ich mich noch lange nicht gut genug, aber meine Zeit wird kommen. :D