ubuntuusers.de

"error: implicit declaration of function" beim Kompilieren

Status: Ungelöst | Ubuntu-Version: Kein Ubuntu
Antworten |

sparrow

Anmeldungsdatum:
19. Dezember 2005

Beiträge: 85

Hallo Forum,

ich versuche das Programm "Max Control" [1] aus diesem Archiv [2] zu kompilieren. ./configure läuft problemlos durch (keine Optionen von mir gesetzt), also gehe ich davon aus, dass die entsprechenden Bibliotheken vorhanden sind. Wenn ich jedoch versuche make auszuführen, dann kommt es zu folgenden Fehlern:

max.c:161:3: error: implicit declaration of function ‘gtk_widget_set_margin_start’ [-Werror=implicit-function-declaration]
   gtk_widget_set_margin_start(grid, 6);

Der Fehler "implicit declaration of function" kommt sehr häufig für verschiedene GTK-Funktionen.

Etwas Recherche sagte, ich soll ohne "-WError"-Parameter kompilieren, allerdings sind meine Versuche dahingehend fehlgeschlagen.

 ./configure --disable-werror 

führt zu den selben Problemen, wobei ich dachte, dass das genau das abstellen soll.

Kann mir jemand unter die Arme greifen? Verwendet wird Ubuntu 14.04.

[1] http://de.tabos.org/max [2] http://www.tabos.org/download/max-control-0.4.1.tar.xz

snafu1

Avatar von snafu1

Anmeldungsdatum:
5. September 2007

Beiträge: 2133

Wohnort: Gelsenkirchen

sparrow schrieb:

./configure läuft problemlos durch (keine Optionen von mir gesetzt), also gehe ich davon aus, dass die entsprechenden Bibliotheken vorhanden sind.

Prüfe aber trotzdem zur Sicherheit mal, ob das Paket libgtk2.0-dev bei dir installiert ist.

Vermuten ist gut. Kontrolle ist besser. 😉

sparrow

(Themenstarter)

Anmeldungsdatum:
19. Dezember 2005

Beiträge: 85

Danke für den Hinweis, snafu. Aber das war es leider nicht.

sparrow@terra ~/temp/max-control-0.4.1 % sudo apt-get install libgtk2.0-dev libgtk-3-dev
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
libgtk-3-dev ist schon die neueste Version.
libgtk2.0-dev ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 19 nicht aktualisiert 

rklm Team-Icon

Projektleitung

Anmeldungsdatum:
16. Oktober 2011

Beiträge: 13174

sparrow schrieb:

Etwas Recherche sagte, ich soll ohne "-WError"-Parameter kompilieren, allerdings sind meine Versuche dahingehend fehlgeschlagen.

 ./configure --disable-werror 

führt zu den selben Problemen, wobei ich dachte, dass das genau das abstellen soll.

Das ist eine schlechte Idee. Ich würde lieber den Fehler beheben als ihn zu unterdrücken.

Sind alle Include-Verzeichnisse im Makefile richtig gesetzt? Sind die passenden #include-Direktiven in den Quellen und den Headern vorhanden?

sparrow

(Themenstarter)

Anmeldungsdatum:
19. Dezember 2005

Beiträge: 85

rklm schrieb:

Sind alle Include-Verzeichnisse im Makefile richtig gesetzt? Sind die passenden #include-Direktiven in den Quellen und den Headern vorhanden?

Ich denke schon. Sind das die nötigen Informationen um das zu prüfen?

sparrow@terra ~/temp/max-control-0.4.1 % cat src/max.c | grep include | grep gtk
#include <gtk/gtk.h>
sparrow@terra ~/temp/max-control-0.4.1 % cat Makefile | grep gtk                
EXTRA_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12  -Wall -O2
EXTRA_LIBS = -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0  
sparrow@terra ~/temp/max-control-0.4.1 % ls /usr/include/gtk-3.0/gtk/gtk.h 
/usr/include/gtk-3.0/gtk/gtk.h
sparrow@terra ~/temp/max-control-0.4.1 %

rklm Team-Icon

Projektleitung

Anmeldungsdatum:
16. Oktober 2011

Beiträge: 13174

Hm...

Hast Du mal nach der Definition der Funktion gefahndet? Also so etwas wie

1
fgrep -rw gtk_widget_set_margin_start /usr/include/gtk-3.0

(Ggf. noch weitere Verzeichnisse von GTK hinzufügen, die nicht unterhalb von /usr/include/gtk-3.0 liegen.)

Man könnte auch noch die Übersetzung mit -E laufen lassen, damit man sieht, was vor der Zeile steht, die die Fehlermeldung verursacht. Theoretisch müsste die Deklaration der Funktion fehlen - oder aber sie hat andere Argumenttypen.

Roughtrade

Avatar von Roughtrade

Anmeldungsdatum:
25. November 2008

Beiträge: 294

Wohnort: Berlin

Bist Du schon weiter gekommen ? Habe das gleiche Problem und habe jetzt das Problem mit der Original MAC Software gelöst. Die läuft 😉

Du holst Dir die aktuelle Version für Mac vom Portal https://www.max-portal.elv.de/login.jsp

Du musst das dmg entpacken, wofür Du dmg2img benötigst;

1
2
3
4
5
6
7
sudo apt-get install dmg2img

dmg2img -i MAXApp_ELV.dmg test.dmg

mkdir /tmp/dmg

sudo mount -t hfsplus -o loop test.dmg /tmp/dmg/

Dann solltest Du die Dateien in /tmp/dmg/ finden.

Diese kopierst Du in ein Verzeichis und startest MAX! folgendermaßen:

1
java -jar /home/user/test/Java/MaxLocalApp.jar 

Noch eine Anmerkung; die Datei root.war musst Du ausführbar machen und den Besitz übernehmen.

Grüße

UPDATE: Bitte überprüfe ob das Paket hfsplus auf Deinem System installiert ist. Es wird für das Mounten zwingend benötigt.

totolenz

Anmeldungsdatum:
20. März 2016

Beiträge: 5

Die o.g. Anleitung für Max funktioniert (Ubuntu 14.04 mit der Max-Software für MAC in der Version 1.4.5). Ich musste im entpackten Ordner die Besitzrechte in einem Terminal mit

1
sudo chown -cR nutzer:nutzergruppe /Maxordner/

anpassen und danach das o.g. Ausführungsrecht setzen (das geht dann ohne Terminal mit dem Dateibrowser und "Eigenschaften" im Kontextmenü - "Datei als Programm ausführen").

Der entpackte Ordner der Maxsoftware enthält einen Unterordner "MAX!apps" der sich wegen des Ausrufzeichens nicht im Java-Startbefehl nutzen lässt. Einfaches Umbenennen des Ordners (z.B. in "MAXapps") behebt das Problem.

rm369

Anmeldungsdatum:
28. August 2010

Beiträge: 3

Nochmal zu der Frage oben: Der Linkfehler tritt nicht mehr auf,wenn man src/Makefile.am ändert in

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
bin_PROGRAMS = max

AM_CFLAGS = -I$(top_srcdir)
AM_CPPFLAGS = -DMAX_LOCALEDIR=\"${MAX_LOCALEDIR}\"

max_CFLAGS = $(EXTRA_CFLAGS) $(AM_CFLAGS) $(SOUP_CFLAGS)
max_LDFLAGS = -export-dynamic
max_LDADD = $(EXTRA_LIBS) $(SOUP_LIBS)

max_SOURCES =\
	about.c\
	about.h\
	cube.c\
	cube.h\
	cube_object.c\
	cube_object.h\
	max.c\
	max.h

Rolf_Bensch

Anmeldungsdatum:
25. April 2007

Beiträge: 71

Mit dieser Änderung läuft hier ./configure problemlos durch. Allerdings erhalte ich Fehlermeldungen bei make. Hat jemand eine Idee (bin da nicht so firm)?

Grüße Rolf

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Ubuntu:~/Downloads/max-control-0.4.2$ make
make  all-recursive
make[1]: Verzeichnis »/home/rolf/Downloads/max-control-0.4.2« wird betreten
Making all in src
make[2]: Verzeichnis »/home/rolf/Downloads/max-control-0.4.2/src« wird betreten
gcc -DHAVE_CONFIG_H -I. -I..  -DMAX_LOCALEDIR=\"/usr/share/locale\"  -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12   -Wall -O2 -I.. -pthread -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -g -O2 -MT max-max.o -MD -MP -MF .deps/max-max.Tpo -c -o max-max.o `test -f 'max.c' || echo './'`max.c
max.c: In function ‘temperature_button_press_event’:
max.c:155:2: warning: implicit declaration of function ‘gtk_popover_new’ [-Wimplicit-function-declaration]
  popover = gtk_popover_new(widget);
  ^
max.c:155:10: warning: assignment makes pointer from integer without a cast [enabled by default]
  popover = gtk_popover_new(widget);
          ^
max.c:160:2: warning: implicit declaration of function ‘gtk_widget_set_margin_start’ [-Wimplicit-function-declaration]
  gtk_widget_set_margin_start(box, 18);
  ^
max.c:161:2: warning: implicit declaration of function ‘gtk_widget_set_margin_end’ [-Wimplicit-function-declaration]
  gtk_widget_set_margin_end(box, 18);
  ^
max.c:176:2: warning: implicit declaration of function ‘gtk_popover_popup’ [-Wimplicit-function-declaration]
  gtk_popover_popup(GTK_POPOVER(popover));
  ^
max.c:176:2: warning: implicit declaration of function ‘GTK_POPOVER’ [-Wimplicit-function-declaration]
max.c: In function ‘max_rebuild_ui_idle’:
max.c:340:3: warning: implicit declaration of function ‘gtk_flow_box_insert’ [-Wimplicit-function-declaration]
   gtk_flow_box_insert(GTK_FLOW_BOX(max_room_flowbox), frame, -1);
   ^
max.c:340:3: warning: implicit declaration of function ‘GTK_FLOW_BOX’ [-Wimplicit-function-declaration]
max.c: In function ‘max_update_ui_idle’:
max.c:429:4: warning: implicit declaration of function ‘gtk_switch_set_state’ [-Wimplicit-function-declaration]
    gtk_switch_set_state(GTK_SWITCH(ui->mode), !cube_device_get_mode(device));
    ^
max.c: In function ‘max_rename_room’:
max.c:513:68: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(remove), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                    ^
max.c:513:68: note: each undeclared identifier is reported only once for each function it appears in
max.c: In function ‘max_remove_room’:
max.c:575:68: error: ‘GTK_STYLE_CLASS_DESTRUCTIVE_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(remove), GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
                                                                    ^
max.c: In function ‘max_rename_device’:
max.c:617:68: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(remove), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                    ^
max.c: In function ‘max_remove_device’:
max.c:695:68: error: ‘GTK_STYLE_CLASS_DESTRUCTIVE_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(remove), GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
                                                                    ^
max.c: In function ‘max_temperature’:
max.c:782:106: error: ‘GTK_DIALOG_USE_HEADER_BAR’ undeclared (first use in this function)
  dialog = gtk_dialog_new_with_buttons(_("Temperatures"), GTK_WINDOW(max_main_window), GTK_DIALOG_MODAL | GTK_DIALOG_USE_HEADER_BAR, _("Cancel"), GTK_RESPONSE_CANCEL, _("Apply"), GTK_RESPONSE_OK, NULL);
                                                                                                          ^
max.c: In function ‘max_internet’:
max.c:865:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘max_account’:
max.c:918:101: error: ‘GTK_DIALOG_USE_HEADER_BAR’ undeclared (first use in this function)
  dialog = gtk_dialog_new_with_buttons(_("Account"), GTK_WINDOW(max_main_window), GTK_DIALOG_MODAL | GTK_DIALOG_USE_HEADER_BAR, _("Close"), GTK_RESPONSE_OK, NULL);
                                                                                                     ^
max.c: In function ‘max_boost’:
max.c:967:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘max_program’:
max.c:1367:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘max_offset’:
max.c:1432:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘max_display’:
max.c:1507:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘house_auto_cb’:
max.c:1593:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘house_comfort_cb’:
max.c:1674:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘house_eco_cb’:
max.c:1801:67: error: ‘GTK_STYLE_CLASS_SUGGESTED_ACTION’ undeclared (first use in this function)
  gtk_style_context_add_class(gtk_widget_get_style_context(apply), GTK_STYLE_CLASS_SUGGESTED_ACTION);
                                                                   ^
max.c: In function ‘max_app_activate’:
max.c:2308:2: warning: implicit declaration of function ‘gtk_flow_box_new’ [-Wimplicit-function-declaration]
  max_room_flowbox = gtk_flow_box_new();
  ^
max.c:2308:19: warning: assignment makes pointer from integer without a cast [enabled by default]
  max_room_flowbox = gtk_flow_box_new();
                   ^
max.c:2310:2: warning: implicit declaration of function ‘gtk_flow_box_set_selection_mode’ [-Wimplicit-function-declaration]
  gtk_flow_box_set_selection_mode(GTK_FLOW_BOX(max_room_flowbox), GTK_SELECTION_NONE);
  ^
max.c:2311:2: warning: implicit declaration of function ‘gtk_flow_box_set_row_spacing’ [-Wimplicit-function-declaration]
  gtk_flow_box_set_row_spacing(GTK_FLOW_BOX(max_room_flowbox), 5);
  ^
max.c:2312:2: warning: implicit declaration of function ‘gtk_flow_box_set_column_spacing’ [-Wimplicit-function-declaration]
  gtk_flow_box_set_column_spacing(GTK_FLOW_BOX(max_room_flowbox), 5);
  ^
max.c:2313:2: warning: implicit declaration of function ‘gtk_flow_box_set_homogeneous’ [-Wimplicit-function-declaration]
  gtk_flow_box_set_homogeneous(GTK_FLOW_BOX(max_room_flowbox), TRUE);
  ^
make[2]: *** [max-max.o] Fehler 1
make[2]: Verzeichnis »/home/rolf/Downloads/max-control-0.4.2/src« wird verlassen
make[1]: *** [all-recursive] Fehler 1
make[1]: Verzeichnis »/home/rolf/Downloads/max-control-0.4.2« wird verlassen
make: *** [all] Fehler 2

rm369

Anmeldungsdatum:
28. August 2010

Beiträge: 3

Nach der Änderung oben (max_LDADD) müssen folgende drei Befehle auf der obersten Ebene des Pakets ausgeführt werden:

1
2
3
aclocal
automake --add-missing
autoconf

Danach wie üblich

1
2
3
./configure
make
sudo make install

Rolf_Bensch

Anmeldungsdatum:
25. April 2007

Beiträge: 71

Das klappt noch nicht. Zunächst war noch erforderlich:

1
 sudo apt-get install pkgconf

für autoconf dann noch

1
ACLOCAL='aclocal -I /usr/share/aclocal' ./autogen.sh

danach meckert ./configure:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
configure: error: Package requirements (glib-2.0 >= 2.32 gio-2.0 >= 2.32 gtk+-3.0) were not met:

Package atspi-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `atspi-2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'atspi-2', required by 'atk-bridge-2.0', not found
 

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables EXTRA_CFLAGS
and EXTRA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

An dieser Stelle komme ich nicht weiter.

Antworten |