Hello World - Plugin will nicht

Games, Plugins, Utils, Tools, 3rdParty, etc...
Antworten
lano
Interessierter
Interessierter
Beiträge: 45
Registriert: Montag 20. August 2007, 17:57

Hello World - Plugin will nicht

Beitrag von lano »

moin,
nachdem ich nun zahlreiche Beiträge zur Pluginerstellung gelesen habe funktioniert dieses auch insoweit das das plugin problemlos erstellt wird.
Um erstmal zu testen hab ich einfach das Hallo Welt Bsp. genommen.
die .cfg schaut so aus:
type=2
name=Quotenmeter
desc=sendet die TV-Quote
needfb=0
needlcd=0
needrc=0
needoffsets=0
die .cpp so:
#include "quotenmeter.h"
void plugin_exec(PluginParam *par) {
printf("Hallo Welt \n");
return;
}
die .h so
#include "stdio.h"
#include "plugin.h"
plugin - also die .cfg und .so nach /var/tuxbox/plugins kopiert, plugins neu geladen und mal gestartet.

als ausgabe kommt allerdings nix von hallo und schon garnicht von welt sondern:
/var/tuxbox/plugins/quotenmeter.so: undefined symbol: plugin_exec/dev/input/event1: No such file or directory
event1 gibt es auch nicht, da hat die ausgabe schon recht, also symlink von event0 zu event1 erstellt und nochmal gestartet.
nun erhalte ich als ausgabe:
/var/tuxbox/plugins/quotenmeter.so: undefined symbol: plugin_exec
nun bin ich erstmal ratlos, jemand ne idee dazu?
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: Hello World - Plugin will nicht

Beitrag von Houdini »

wie sieht dein makefile aus?
lano
Interessierter
Interessierter
Beiträge: 45
Registriert: Montag 20. August 2007, 17:57

Re: Hello World - Plugin will nicht

Beitrag von lano »

Makefile.am im Pluginverzeichniss so:
AM_CPPFLAGS = \
@FREETYPE_CFLAGS@ \
-I$(top_srcdir)/include

noinst_LTLIBRARIES = quotenmeter.la

quotenmeter_la_SOURCES = quotenmeter.cpp

if BOXTYPE_DREAMBOX
quotenmeter_la_CFLAGS = -DOLDFT
endif

quotenmeter_la_LIBADD = \
@FREETYPE_LIBS@

quotenmeter_la_LDFLAGS = -rpath $(PLUGINDIR) -module -avoid-version

install-exec-local:
install -d $(DESTDIR)$(PLUGINDIR)
install -d $(DESTDIR)$(CONFIGDIR)
install -d $(DESTDIR)$(CONFIGDIR)/quotenmeter
$(LIBTOOL) --mode=install install quotenmeter.la $(DESTDIR)$(PLUGINDIR)
install -m 0644 $(srcdir)/quotenmeter.cfg $(DESTDIR)$(PLUGINDIR)
für die anderen hab ich nen patch
die Makefile.am:
--- /usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/Makefile.am 2010-04-23 14:53:29.000000000 +0200
+++ /usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/Makefile.am 2010-08-25 23:43:29.000000000 +0200
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = gnu

SUBDIRS = \
- include tuxmail tuxtxt tuxcom tuxcal tuxclock fx2 vncviewer enigma shellexec tuxwetter sysinfo clock logomask blockads links
+ include tuxmail tuxtxt tuxcom tuxcal tuxclock fx2 vncviewer enigma shellexec tuxwetter sysinfo clock logomask blockads links quotenmeter

if BOXTYPE_DREAMBOX
SUBDIRS += pip mosaic
Die configure.ac
--- /usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/configure.ac 2010-04-23 14:53:29.000000000 +0200
+++ /usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/configure.ac 2010-08-25 23:42:16.000000000 +0200
@@ -70,6 +70,7 @@
fx2/sol/Makefile
fx2/c64emu/Makefile
fx2/sudoku/Makefile
+quotenmeter/Makefile
tuxmail/Makefile
tuxmail/daemon/Makefile
tuxcal/Makefile
und die plugins.mk so:
--- plugins.mk 2010-04-23 14:53:29.000000000 +0200
+++ plugins.mk.neu 2010-08-26 03:13:17.000000000 +0200
@@ -36,6 +36,13 @@
$(MAKE) -C $(appsdir)/tuxbox/plugins/tuxtxt install prefix=$(flashprefix)/root
@FLASHROOTDIR_MODIFIED@

+quotenmeter: $(appsdir)/tuxbox/plugins/config.status
+ $(MAKE) -C $(appsdir)/tuxbox/plugins/quotenmeter all install
+
+flash-quotenmeter: $(appsdir)/tuxbox/plugins/config.status | $(flashprefix)/root
+ $(MAKE) -C $(appsdir)/tuxbox/plugins/quotenmeter all install prefix=$(flashprefix)/root
+ @FLASHROOTDIR_MODIFIED@
+
tuxcom: $(appsdir)/tuxbox/plugins/config.status
$(MAKE) -C $(appsdir)/tuxbox/plugins/tuxcom all install
der durchlauf von make so:
make -C /usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/quotenmeter all install
make[1]: Entering directory `/usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/quotenmeter'
make[1]: Für das Ziel »all« ist nichts zu tun.
make[2]: Entering directory `/usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/quotenmeter'
install -d /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins
install -d /usr/src/tuxbox/dbox/cdkroot/var/tuxbox/config
install -d /usr/src/tuxbox/dbox/cdkroot/var/tuxbox/config/quotenmeter
/bin/sh ../libtool --mode=install install quotenmeter.la /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins
install .libs/quotenmeter.so /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins/quotenmeter.so
install .libs/quotenmeter.lai /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins/quotenmeter.la
PATH="$PATH:/sbin" ldconfig -n /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins
----------------------------------------------------------------------
Libraries have been installed in:
/usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
install -m 0644 ./quotenmeter.cfg /usr/src/tuxbox/dbox/cdkroot/lib/tuxbox/plugins
make[2]: Für das Ziel »install-data-am« ist nichts zu tun.
make[2]: Leaving directory `/usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/quotenmeter'
make[1]: Leaving directory `/usr/src/tuxbox/tuxbox-cvs/apps/tuxbox/plugins/quotenmeter'
Houdini
Developer
Beiträge: 2183
Registriert: Mittwoch 10. Dezember 2003, 07:59

Re: Hello World - Plugin will nicht

Beitrag von Houdini »

mach mal aus quotenmeter.cpp quotenmeter.c
oder plugin_exec als extern "c"
lano
Interessierter
Interessierter
Beiträge: 45
Registriert: Montag 20. August 2007, 17:57

Re: Hello World - Plugin will nicht

Beitrag von lano »

Öhm hüstel hüstel...
[CPlugins] try exec...
Hallo Welt
[CPlugins] exec done...
funktioniert :D
Danke
Ich muss zugeben, ich bin eher so der script sprachen typ, von c und c++, hatt ich noch nie ahnung und wies aussieht wird sich da wohl auch nicht großartig was ändern....
allerdings was mir da an wissen fehlt, mach ich in der regel durch Hartnäckigkeit wieder weg.... Ich bin was sowas angeht sehr hartnäckig.
Ich kann nur sagen gut das es dieses Forum gibt, gut das solche Leute hier im Forum versammelt sind, ohne euch wären blödel wie ich der Materie hilflos ausgeliefert.

An dieser Stelle mal ein großes Lob an alle tuxboxjaner, so ein Forum wie dieses gibt es sehr sehr selten, die Hilfsbereitschaft ist riesen groß, bisher waren immer alle freundlich und kompetent. wäre eigendlich mal einen extra Dankeschön-thread wert, spätestens zum 10jährigen Jubiläum :wink:
so gibt noch viel zu tun, die nacht ist noch jung, die nächste frage kommt bestimmt......
lano
Interessierter
Interessierter
Beiträge: 45
Registriert: Montag 20. August 2007, 17:57

Re: Hello World - Plugin will nicht

Beitrag von lano »

Nach einer nacht experimentieren mit mehr oder weniger erfolg, wieder back to basics

ich hab nun eine main.cpp mit inhalt:
#include "main.h"
extern "C" {
void plugin_exec(PluginParam *par) {
printf("Hallo Welt \n");
return;
}
}
die main.h so:
#include "stdio.h"
#include "plugin.h"
starte ich die ganze sache gibt es auch eine ausgabe und zwar so:
CPlugins] try exec...
Hallo Welt
[CPlugins] exec done...
/dev/input/event1: No such file or directory
mich irritiert leicht das er zwar exec done sacht danach aber immer die zeile mit event1 :gruebel:
gibts da nen trick oder brauch ich erstmal nen Volkshochschulkurs :D
seife
Developer
Beiträge: 4189
Registriert: Sonntag 2. November 2003, 12:36

Re: Hello World - Plugin will nicht

Beitrag von seife »

Das device hat mit deinem Plugin nichts zu tun, das ist der Plugin-Wrapper code vom neutrino, der das benutzen will.

Ignorier die Meldung einfach.

Edit: genauer ist es die open() Funktion in rcinput. Die versucht auf der dbox input0 und input1 zu öffnen, input0 ist die Fernbedienung, input1 vermutlich die Tastatur. Wenn keine Tastatur da ist...

Dieselbe Meldung siehst du auch beim Neutrino-Start.
lano
Interessierter
Interessierter
Beiträge: 45
Registriert: Montag 20. August 2007, 17:57

Re: Hello World - Plugin will nicht

Beitrag von lano »

Ah, ok
Meld ich den Kurs wieder ab :lol:
Antworten