It doesn't like the new line you suggest.  Compile errors are below.  It
does like Doug Scoular's suggestion to put it back to the way it was in
0.17.

[EMAIL PROTECTED]:~/download/mythtv.18/mythplugins-0.18/mythbrowser> make
cd mythbrowser && make -f Makefile
make[1]: Entering directory
`/home/mythtv/download/mythtv.18/mythplugins-0.18/mythbrowser/mythbrowse
r'
g++ -c -pipe -Wall -W -O3 -march=pentiumpro -fomit-frame-pointer
-D_REENTRANT  -D_GNU_SOURCE -DPREFIX=\"/usr/local\" -DHAVE_MMX
-DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED
-I/usr/local/lib/qt3/mkspecs/default -I. -I/usr/local/include
-I/usr/include/kde -I/opt/kde3/include -I/usr/local/lib/qt3/include -o
main.o main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:65: error: no matching function for call to
`KCmdLineArgs::init(int&, 
   char**&, const char[12], const char[12], char[53], const char*&,
bool)'
/opt/kde3/include/kcmdlineargs.h:213: error: candidates are: static void

   KCmdLineArgs::init(int, char**, const char*, const char*, const
char*, bool)
/opt/kde3/include/kcmdlineargs.h:226: error:                 static void

   KCmdLineArgs::init(int, char**, const KAboutData*, bool)
/opt/kde3/include/kcmdlineargs.h:238: error:                 static void

   KCmdLineArgs::init(const KAboutData*)
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
`/home/mythtv/download/mythtv.18/mythplugins-0.18/mythbrowser/mythbrowse
r'
make: *** [sub-mythbrowser] Error 2

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul
Sent: Tuesday, May 03, 2005 6:21 AM
To: mythtv-users@mythtv.org
Subject: [mythtv-users] Re: mythbrowser 0.18

>Hi All,
>I've been trying to debug the mythbrowser 0.18 segmentation violation. 
>I've been using gdb, here is where the problem
>starts:

>Breakpoint 2, main (argc=2, argv=0xbffff684) at main.cpp:78
>78 KApplication a(argc,argv);
>(gdb) s

>Program received signal SIGSEGV, Segmentation fault.
>0x41161569 in KCmdLineArgs::count () from 
>/usr/kde/3.2/lib/libkdecore.so.4

>KApplication is allocating "a" and thus calling it's constructor. The 
>constructor seems unhappy.

>To be honest I suspected this was a problem with outdated libraries. I 
>have a fairly out of date gentoo system. Here's the output of
>kde-config:

>spug mythbrowser # kde-config --version
>Qt: 3.3.3
>KDE: 3.2.2
>kde-config: 1.0

>Then I decided to compare mythbrowser 0.18 with 0.17 and found that the

>way the command line arguments are being initialised has changed:

>KCmdLineArgs::init(argc, argv, "mythbrowser", usage , version);

>Had become:

>KCmdLineArgs::init(argc, argv, "mythbrowser", "mythbrowser", usage , 
>version);

>In mythbrowser 0.18.

>I simply changed this back and all started working again.

>Hope this helps...

>Cheers,

>Doug Scoular

Thanks Doug. I think we are making some progress now :-) It looks like
we're exposing a  bug in the kde3.2.x version of KCmdLineArgs to me. I
use 3.3.0 and 3.3.1 and it works fine.

I changed the call to KCmdLineArgs::init because the old call kept
producing a compiler warning about 'init' is deprecated or something
similar.

Because I can't reproduce the problem here it is not possible for me to
debug it.
If you have the time there is a few things you could try to track the
problem down.

Its a long shot but I wonder if  the compiler is getting confused about
which init call to use. Though I can't see how that could be.

Could you try changing it to this and try again.:-
KCmdLineArgs::init(argc, argv, "mythbrowser", "mythbrowser", usage,
version, false);

That should remove any ambiguity about which call to use for the
compiler.

Another thing I noticed looking at the code is the order in which the
arguments are parsed and the creation of the KApplication object looks
back to front to me.
Move 'KApplication a(argc, argv)' to just after
'KCmdLineArgs::addCmdLineOptions(options)'
and before KCmdLineArgs * args = KCmdLineArgs::parsedArgs(); so it looks
something like this:-

KCmdLineArgs::init(argc, argv, "mythbrowser", "mythbrowser", usage,
version, false); KCmdLineArgs::addCmdLineOptions(options);
KApplication a(argc, argv);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

That looks more like the example code in the KDE docs. In fact I don't
think we need to pass the arguments to KApplication at all and just
replace KApplication a(argc, argv) with KApplication a;

Thanks for your time.

Paul





_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to