Portál AbcLinuxu, 10. května 2025 05:34
int main(){}
), gcc4.0 mi to stejne odmitne zkompilovat a vyhodi furu chyb typu
/usr/local/include/libwnck-1.0/libwnck/screen.h:123: error: expected constructor, destructor, or type conversion before ‘*’ token /usr/local/include/libwnck-1.0/libwnck/screen.h:124: error: expected constructor, destructor, or type conversion before ‘*’ token /usr/local/include/libwnck-1.0/libwnck/screen.h:129: error: ‘gboolean’ does not name a type /usr/local/include/libwnck-1.0/libwnck/screen.h:131: error: ‘gulong’ does not name a type /usr/local/include/libwnck-1.0/libwnck/screen.h:134: error: ‘gboolean’ does not name a type /usr/local/include/libwnck-1.0/libwnck/screen.h:136: error: ‘gboolean’ has not been declared /usr/local/include/libwnck-1.0/libwnck/screen.h:148: error: ‘G_END_DECLS’ does not name a type /usr/local/include/libwnck-1.0/libwnck/application.h:43: error: ‘GObject’ does not name a type /usr/local/include/libwnck-1.0/libwnck/application.h:50: error: ‘GObjectClass’ does not name a type /usr/local/include/libwnck-1.0/libwnck/application.h:53: error: ‘WnckApplication’ has not been declared /usr/local/include/libwnck-1.0/libwnck/application.h:56: error: ‘WnckApplication’ has not been declared /usr/local/include/libwnck-1.0/libwnck/application.h:59: error: ‘GType’ does not name a type /usr/local/include/libwnck-1.0/libwnck/application.h:61: error: expected constructor, destructor, or type conversion before ‘*’ token /usr/local/include/libwnck-1.0/libwnck/application.h:63: error: ‘gulong’ does not name a type /usr/local/include/libwnck-1.0/libwnck/application.h:65: error: expected constructor, destructor, or type conversion before ‘*’ token /usr/local/include/libwnck-1.0/libwnck/application.h:66: error: ‘WnckApplication’ was not declared in this scope /usr/local/include/libwnck-1.0/libwnck/application.h:66: error: ‘app’ was not declared in this scope /usr/local/include/libwnck-1.0/libwnck/application.h:73: error: ‘WnckApplication’ was not declared in this scope(ve skutecnosti je jich asi ctyrikrat vic) Zkousel jsem nainstalovat hned nekolik verzi libwnck (predchozi jsem samozrejme odinstalovaval), ale nijak to nepomohlo. Taky jsem zkousel gcc3.2, to taky nepomohlo. BTW, ten includovaci adresar se sice jmenuje vzdycky libwnck-1.0, ale verze co jsem zkousel byly 2.6, 2.10 a 2.13.
Myslím, že Ti chybí knihovny, které libwnck využívá.
#define WNCK_I_KNOW_THIS_IS_UNSTABLE #include >libwnck/libwnck.h< int main (void) { }
Příkaz pro překlad:
gcc $(pkg-config --cflags libwnck-1.0) main.c
Výstup pkg-config --cflags libwnck-1.0:
-DXTHREADS -I/usr/include/libwnck-1.0 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
[ivok@zero ~]$ rpm -qa|grep libwnck libwnck-1_16-2.10.3-3mdk libwnck-1_16-devel-2.10.3-3mdk libwnck-2.10.3-3mdk [ivok@zero ~]$ cat x.c #include "libwnck/libwnck.h" int main () { return 0; } [ivok@zero ~]$ gcc x.c `pkg-config --libs --cflags libwnck-1.0` In file included from /usr/include/libwnck-1.0/libwnck/libwnck.h:28, from x.c:1: /usr/include/libwnck-1.0/libwnck/window.h:26:2: error: #error "libwnck should only be used if you understand that it's subject to frequent change, and is not supported as a fixed API/ABI or as part of the platform" [ivok@zero ~]$ gcc x.c `pkg-config --libs --cflags libwnck-1.0` -DWNCK_I_KNOW_THIS_IS_UNSTABLE [ivok@zero ~]$
wnck_screen_get_active_workspace
nebo wnck_screen_get_default
, kompilator mi vzdycky hlasi,
ze ji nezna /tmp/ccYLqwIy.o(.text+0xd7): In function `main': main.cpp: undefined reference to `wnck_screen_get_default' /tmp/ccYLqwIy.o(.text+0xe0):main.cpp: undefined reference to `wnck_screen_get_active_workspace' /tmp/ccYLqwIy.o(.text+0xf1):main.cpp: undefined reference to `wnck_workspace_get_number' collect2: ld returned 1 exit statusNebijte mne prosim, jestli je to nejaka blbost, ja se C++ teprve ucim...
$ gcc $(pkg-config --cflags --libs libwnck-1.0) main.c
Ještě jsem zapomněl přidat flag --libs
.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.