2013-05-30 1 views
0

그놈 패널 애플릿을 xfce 패널 플러그인으로 변환하고 있습니다. 지금까지 소스에서 몇 가지 그놈 특정 부분을 제거하고 xfce 특정 소스로 대체했습니다.XFCE4 패널 플러그인 컴파일

weather plugin 및 예제 플러그인과 같은 템플릿을 사용하여 makefile.am 및 configure.ac 파일을 만들었습니다. 그러나 나는 제대로 컴파일에 실패합니다. 나는 분명히 뭔가 빠졌을 것입니다. 그러나 필자는 자신의 파일로 예제를 두 번 확인했는데 명백한 문제는 발견하지 못했습니다.

나는 누군가에게 아이디어가있는 희망으로 오류의 출력뿐만 아니라 적절한 파일을 첨부했습니다. 문제가 실제 소스에 있다고 생각하지 않지만 필요한 경우 나중에 문제를 추가 할 수 있습니다.

오류 컴파일하는 동안 :

make all-recursive 
make[1]: Entering directory `/source/my_example_xfce' 
Making all in panel-plugin 
make[2]: Entering directory `/source/my_example_xfce/panel-plugin' 
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DTHEMESDIR=\"/usr/local/share/xfce4/my_example/icons\" -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"my_example\" -DNDEBUG -pthread -I/usr/include/xfce4/libxfce4panel-1.0 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/xfce4 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -I/usr/include/xfce4 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/xfce4 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12               -g -O2 -MT xfce4_my_example_plugin-my_example.o -MD -MP -MF .deps/xfce4_my_example_plugin-my_example.Tpo -c -o xfce4_my_example_plugin-my_example.o `test -f 'my_example.c' || echo './'`my_example.c 

my_example.c:25:25: warning: ‘struct Example_Data’ declared inside parameter list [enabled by default] 
my_example.c:25:25: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] 
my_example.c: In function ‘setdefaults’: 
my_example.c:28:3: warning: incompatible implicit declaration of built-in function ‘strncpy’ [enabled by default] 
my_example.c:28:21: error: dereferencing pointer to incomplete type 
my_example.c:28:45: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default] 
my_example.c:28:3: warning: passing argument 1 of ‘strlen’ makes pointer from integer without a cast [enabled by default] 
my_example.c:28:3: note: expected ‘const char *’ but argument is of type ‘int’ 
my_example.c:28:3: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast [enabled by default] 
my_example.c:28:3: note: expected ‘const char *’ but argument is of type ‘int’ 
my_example.c:30:21: error: dereferencing pointer to incomplete type 
my_example.c:30:42: error: dereferencing pointer to incomplete type 
my_example.c:30:67: error: dereferencing pointer to incomplete type 
my_example.c:31:3: warning: incompatible implicit declaration of built-in function ‘strncat’ [enabled by default] 
my_example.c:31:21: error: dereferencing pointer to incomplete type 
my_example.c:31:32: error: ‘SIGFILE’ undeclared (first use in this function) 

SIGFILE 내 헤더 파일에 정의 중 하나입니다. 그런 다음 모든 헤더 파일을 읽지 않는 것처럼 계속 진행됩니다.

마지막 비트 : 나는 붙여 넣기 아래

my_example.c:248:17: error: unknown type name ‘XfcePanelPlugin’ 
my_example.c:248:42: error: unknown type name ‘GtkWidget’ 
my_example.c:248:60: error: unknown type name ‘GtkWidget’ 
make[2]: *** [xfce4_my_example_plugin-example.o] Error 1 
make[2]: Leaving directory `/source/my_example_xfce/panel-plugin' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/source/my_example_xfce' 
make: *** [all] Error 2 

Makefile.am, 소스 디렉토리에서 실행 들어 xfce4 XDT-autgen 도구에 필요한 configure.ac 및 패널 플러그인/Makefile.am 것 적절한 make를 생성하고 파일을 구성하십시오.

*************** 
* Makefile.am * 
*************** 

SUBDIRS =                \ 
     panel-plugin               \ 
     po 

AUTOMAKE_OPTIONS =              \ 
     1.8                \ 
     dist-bzip2 


***************** 
* configure.ac * 
***************** 

dnl Version information 
m4_define([my_example_version_major], [1]) 
m4_define([my_example_version_minor], [3]) 
m4_define([my_example_version_micro], [0]) 
m4_define([my_example_version], [my_example_version_major().my_example_version_minor().my_example_version_micro()]) 

dnl Initialize autoconf 
AC_COPYRIGHT([Copyright (c) 2013 
     Example <[email protected]>]) 
AC_INIT([xfce4-my_example-plugin], [my_example_version()], [[email protected]]) 
AC_PREREQ([2.50]) 

dnl Initialize automake 
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar]) 
AM_CONFIG_HEADER([config.h]) 
AM_MAINTAINER_MODE() 

dnl Check for basic programs 
AC_PROG_CC() 
AC_PROG_LD() 
AC_PROG_INSTALL() 
AC_PROG_INTLTOOL() 
AC_PROG_LIBTOOL() 
AM_PROG_CC_C_O() 

dnl Check for standard headers 
AC_HEADER_STDC() 
AC_CHECK_HEADERS([string.h fcntl.h errno.h sys/socket.h netdb.h \ 
        netinet/in.h sys/types.h time.h unistd.h stdio.h \ 
        sys/stat.h stddef.h stdlib.h netinet/in.h]) 

dnl Check for i18n support 
XDT_I18N([]) 

dnl Check for required packages 
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0]) 
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0]) 
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90.2]) 
XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90.2]) 
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.1]) 

dnl Check for debugging support 
XDT_FEATURE_DEBUG() 

AC_OUTPUT([ 
Makefile 
po/Makefile.in 
panel-plugin/Makefile 
]) 


**************************** 
* panel-plugin/Makefile.am * 
**************************** 

INCLUDES =                \ 
     -I$(top_srcdir)             \ 
     -DTHEMESDIR=\"$(datadir)/xfce4/my_example/icons\"      \ 
     -DPACKAGE_LOCALE_DIR=\"$(localedir)\"       \ 
     -DG_LOG_DOMAIN=\"my_example\" 
plugin_PROGRAMS =              \ 
     xfce4-my_example-plugin 

plugindir = $(libexecdir)/xfce4/panel-plugins 

xfce4_my_example_plugin_SOURCES =            \ 
     my_example_dat.h             \ 
     my_example_func.h             \ 
     my_example_images.h              \ 
     my_example_applet.c              \ 
     my_example.c               \ 
     my_example_processdata.c            \ 
     my_example_menu.c 

xfce4_my_example_plugin_CFLAGS =            \ 
     $(LIBXFCE4PANEL_CFLAGS)           \ 
     $(LIBXFCEGUI4_CFLAGS)           \ 
     $(LIBXFCE4UTIL_CFLAGS)           \ 
     $(GTK_CFLAGS) 

xfce4_my_example_plugin_LDADD =             \ 
     $(LIBXFCE4PANEL_LIBS)           \ 
     $(LIBXFCE4UTIL_LIBS)           \ 
     $(LIBXFCEGUI4_LIBS)            \ 
     $(GTK_LIBS) 

desktopdir = $(datadir)/xfce4/panel-plugins 

desktop_DATA =               \ 
     my_example.desktop 

@[email protected] 

EXTRA_DIST =               \ 
     my_example.desktop.in 

CLEANFILES =               \ 
     $(desktop_DATA) 

# vi:set ts=8 sw=8 noet ai nocindent syntax=automake: 

나는 소스 파일이 들어 xfce4 관련 변경하기 전에 잘 컴파일 할뿐만 아니라 내 소스 파일에 포함하는 헤더 파일을해야합니까. 첫 번째 소스 파일입니다 example_applet.c에서

Makefile.am

xfce4_my_example_plugin_SOURCES =  \ 
example_dat.h             \ 
example_func.h             \ 
example_images.h             \ 
example_applet.c             \ 
example.c              \ 
example_processdata.c           \ 
example_menu.c 

입력. 원래는 "xfce4_my_example_plugin_SOURCES = example_applet.c"만 남았고 나머지는 해당 파일에서 찾을 수있었습니다. 그것은 같은 오류를 주었다.

#include <gtk/gtk.h> 
#include <glib-object.h> 
#include <string.h> 
#include <libxfce4util/libxfce4util.h> 
#include <libxfce4panel/xfce-panel-plugin.h> 
#include <libxfce4panel/xfce-hvbox.h> 

#include "example_dat.h" /* contains all structures */ 
#include "example_func.h" /* contains all function prototypes used in this program */ 
#include "example_images.h" 
#include "example.c" 
#include "example_processdata.c" 
#include "example_menu.c" 


/* register the xfce plugin */ 
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(example_applet_fill); 

답변

1

내가 문제를 해결 한 것 같습니다. xfce 빌드 프로세스는 그놈 패널 애플릿을 빌드하는 데 사용하는 것과 약간 다릅니다.

그놈 애플릿의 경우 하나의 소스 파일을 사용하여 다른 모든 소스 및 헤더 파일을 포함합니다.

xfce에서는 다양한 플러그인 소스 트리를 살펴본 후에 각 소스 파일에 필요한 헤더가 포함되어 있지만 소스 파일에는 다른 소스 파일이 포함되어 있지 않습니다.

이 수정 프로그램은 다른 원본 파일을 전혀 포함하지 않고 헤더 파일을 포함하도록 각 원본 파일을 변경했습니다.

관련 문제