[mythtv-users] asking for help for the problems about developing simple myth plugins

Xi Jiarong XiJiarong at sp.edu.sg
Thu Feb 22 07:50:31 UTC 2007


the basic folder structure download from SVN as follows(including mythhello
plugin folder according to that sample mythhello plugin building):
(0)/release-0-20-fixes
       (1)/mythtv
               (2)/libs
                     (3)/libmyth
                            (4.1)/mythcontext.h
                            (4.2)/mythdbcon.h
                               ..
       (1)/mythplugins
               (2)mythconfig.mak
               (2)/mythhello
                     (3)mythhello.pro
                     (3)mythhello
                            (4.3)mythhello.h
                            (4.4)main.cpp
                            (4.5)mythhello.cpp
                            (4.6)mythhello.pro
                            (4.7)hello-ui.xml

       (1)/myththemes

question: in the (4.4)main.cpp file, the header files declaration is as
follows(according to that sample mythhello plugin building):
#include <mythtv/mythcontext.h>
#include <mythtv/mythdbcon.h>

however, those c++ header files, such as (4.1)/mythcontext.h and
(4.2)/mythdbcon.h as declared above is in anthote folder, should be:
#include </mythtv/libs/libmyth/mythcontext.h>......

But,if so, then other plugin header declaration still has errors, such as
the mythmusic source code.

PUZZLING!

so, I have the following questions:

(1)the folder structure given by that sample mythhello plugin building is
right? or #include </mythtv/libs/libmyth/mythcontext.h>...... is right? but
when I correct into </mythtv/libs/libmyth/mythcontext.h>......, there are
still some prblems for those header files own, such as some sytax errors
etc...
(2)note: my os is MythDora, which includes mythtv, and I don't need to
install mythtv after finishing installing mythdora, and can use mythtv
directly.
Moreover, there are the same lib and header files in
/root/mythtv/libs/libmyth on my system, does this mean I need not to
compile the myth source code again and the required header files have
exist?
(3)when I build one simple plugin without header files, and don't need to
use any other header files in other folders, just use one main.cpp with
other .pro ...,;
  (3.1)this main.cpp c++ file is right to build plugin with such init, run
and config part? Although I can qmake, make and make install successfully,
but the problem is: mythtv can't open after reboot, just with two seconds
mythtv screen appear, and then dispear and return to Desktop again, the
same instance when double click on MythTV icon on Desktop.

and when I remove the created "libmythhello.so" from the folder:
URL:file:///usr/lib/mythtv/plugins/libmythhello.so, everything return to be
OK, and mythtv can be open again.
  (3.2)after I type mythfrontend -v all on terminal, I can't find any
errors from those message on terminal, how to analyze it?

I am puzzled about this problem, does that means the initialization has
erros, but I just made so simple main.cpp with that simple
mythplugin_init();

Puzzled!
Asking for help, many thanks!
   (3.3)many thanks!

////////////////////////////////////////////////
///// (1) main.cpp
///////////////////////////////////////////////
#ifndef MAIN_CPP
#define MAIN_CPP

extern "C" {
int mythplugin_init(const char *libversion);
int mythplugin_run(void);
int mythplugin_config(void);
}

int mythplugin_init(const char *libversion)
{
return 0;
}
int mythplugin_run (void)
{
return 0;
}

int mythplugin_config (void) { return 0; }

#endif

and

////////////////////////////////////////////////////////////////////////////
/////_(2)_(start) qmake, make and make install on terminal (start)_
///////////////////////////////////////////////////////////////////////////
[root at mythtv mythhello]# qmake
[root at mythtv mythhello]# make
cd mythhello && make -f Makefile
make[1]: Entering directory
`/test_XJR/mythplugintest/mythplugins/mythhello/myth
hello'
g++ -c -pipe -fomit-frame-pointer -pthread -D_THREAD_SAFE -Wall -W -DPIC
-fPIC
-D_GNU_SOURCE -DPREFIX="/usr/" -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG
-DQT_PLUGIN
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.2.2
/mkspecs/f
reebsd-g++ -I. -I/usr/local/Trolltech/Qt-4.2.2/include/QtCore
-I/usr/local/Troll
tech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui
-I/us
r/local/Trolltech/Qt-4.2.2/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2
/include
-I/usr/include -I/usr/kde/3.3/include -I/usr/include -I. -I.
-I/usr/local/inclu
de -o main.o main.cpp
main.cpp:12: warning: unused parameter 'libversion'
g++ -c -pipe -fomit-frame-pointer -pthread -D_THREAD_SAFE -Wall -W -DPIC
-fPIC
-D_GNU_SOURCE -DPREFIX="/usr/" -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG
-DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/local/Trolltech/Qt-4.2.2/mkspecs/f reebsd-g++ -I.
-I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -I/usr/local/Troll
tech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui
-I/us r/local/Trolltech/Qt-4.2.2/include/QtGui
-I/usr/local/Trolltech/Qt-4.2.2/include -I/usr/include
-I/usr/kde/3.3/include -I/usr/include -I. -I. -I/usr/local/inclu de -o
mythhello.o mythhello.cpp
rm -f libmythhello.so
g++ -pthread -Wl,-rpath,/usr/local/Trolltech/Qt-4.2.2/lib -shared -o
libmythhell o.so main.o mythhello.o -L/usr/local/lib -L/usr/kde/3.3/lib
-L/usr/local/Troll tech/Qt-4.2.2/lib -L/usr//lib -lQtGui
-L/test_XJR/qt-x11-opensource-src-4.2.2/li b -L/usr/X11R6/lib -lXext -lX11
-lQtCore -lz -lm -lglib-2.0 -lpthread -ldl
make[1]: Leaving directory
`/test_XJR/mythplugintest/mythplugins/mythhello/mythh ello'
[root at mythtv mythhello]# make install
cd mythhello && make -f Makefile install
make[1]: Entering directory
`/test_XJR/mythplugintest/mythplugins/mythhello/myth hello'
cp -f "libmythhello.so" "/usr/lib/mythtv/plugins/libmythhello.so"
cp -f /test_XJR/mythplugintest/mythplugins/mythhello/mythhello/hello-ui.xml
/usr //share/mythtv/themes/default/
make[1]: Leaving directory
`/test_XJR/mythplugintest/mythplugins/mythhello/mythh ello'
[root at mythtv mythhello]#
////////////////////////////////////////////////////////////////////////////
/////_(2)_(stop) qmake, make and make install on terminal (stop)_
///////////////////////////////////////////////////////////////////////////
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070222/68adf05c/attachment.htm 


More information about the mythtv-users mailing list