[mythtv] lcddevice.cpp:137: error: ‘system’ was not declared in this scope

Ruediger Oertel ro at suse.de
Sun Nov 4 12:29:07 UTC 2007


On Sun, 4 Nov 2007, Bart Schelstraete wrote:

> > > Anybody who has the same problem, and knows what to do?
> >
> > wild guess: you are using a gcc-4.3 snapshot.
> > try to include <stdlib.h> or <cstdlib> which should help.
> >
> > I've already got a patch to be able to compile mythtv with
> > gcc-4.3 but haven't got around to go all the way through mythplugins
> > yet.
> >
> 
> Indeed, I'm currently solving this by adding "#include <stdlib.h>" to
> the cpp files.
> And until now the build is working, except for the osdsurface.h, which
> contained the  'int ystride' 2 times..which resulted in an error.

yes ...

I've attached my current patch for mythtv now.

-- 
with kind regards (mit freundlichem Grinsen),
   Ruediger Oertel (ro at novell.com,ro at suse.de,bugfinder at t-online.de)
----------------------------------------------------------------------
Linux Fatou 2.6.23.1-6-default #1 SMP 2007/10/19 20:37:48 UTC x86_64
Key fingerprint = 17DC 6553 86A7 384B 53C5  CA5C 3CE4 F2E7 23F2 B417
SUSE LINUX Products GmbH,  GF: Markus Rex,   HRB 16746 (AG Nürnberg)
-------------- next part --------------
--- configure
+++ configure
@@ -1840,7 +1840,7 @@
             add_ldflags "-mfdpic"
         ;;
 	*)
-            ARCHFLAGS="$ARCHFLAGS -mcpu=$tune"
+            ARCHFLAGS="$ARCHFLAGS -mtune=$tune"
 	;;
     esac
 fi
--- libs/libmyth/lcddevice.cpp
+++ libs/libmyth/lcddevice.cpp
@@ -14,6 +14,7 @@
 #include "libmythui/mythmainwindow.h"
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <sys/wait.h>	// For WIFEXITED on Mac OS X
 #include <cmath>
 
--- libs/libmyth/lirc.cpp
+++ libs/libmyth/lirc.cpp
@@ -6,6 +6,7 @@
 #include <sys/wait.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #include "mythcontext.h"
 
--- libs/libmyth/managedlist.cpp
+++ libs/libmyth/managedlist.cpp
@@ -1,3 +1,4 @@
+#include <cstdlib>
 using namespace std;
 
 #include "managedlist.h"
--- libs/libmyth/mythdbcon.cpp
+++ libs/libmyth/mythdbcon.cpp
@@ -1,4 +1,5 @@
 #include "unistd.h"
+#include "stdlib.h"
 
 #include "mythdbcon.h"
 
--- libs/libmyth/mythmediamonitor.cpp
+++ libs/libmyth/mythmediamonitor.cpp
@@ -4,6 +4,7 @@
 
 // C++ headers
 #include <iostream>
+#include <typeinfo>
 using namespace std;
 
 // Qt headers
--- libs/libmyth/mythsocket.cpp
+++ libs/libmyth/mythsocket.cpp
@@ -1,6 +1,7 @@
 #include <qapplication.h>
 #include <qstring.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include "mythcontext.h"
 #include "util.h"
 #include "mythsocket.h"
--- libs/libmyth/util.cpp
+++ libs/libmyth/util.cpp
@@ -5,6 +5,7 @@
 // C headers
 #include <cerrno>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 
 // System specific C headers
--- libs/libmyth/xmlparse.cpp
+++ libs/libmyth/xmlparse.cpp
@@ -2,6 +2,7 @@
 using namespace std;
 
 #include <cmath>
+#include <cstdlib>
 
 #include <qapplication.h>
 
--- libs/libmythsoundtouch/cpu_detect_x86_gcc.cpp
+++ libs/libmythsoundtouch/cpu_detect_x86_gcc.cpp
@@ -51,6 +51,7 @@
 #include "config.h"
 
 #ifdef ARCH_X86_64
+#undef ARCH_X86
 #define ARCH_X86
 #endif
 
--- libs/libmythtv/DVDRingBuffer.cpp
+++ libs/libmythtv/DVDRingBuffer.cpp
@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <stdlib.h>
 
 #include "DVDRingBuffer.h"
 #include "mythcontext.h"
--- libs/libmythtv/cc708decoder.cpp
+++ libs/libmythtv/cc708decoder.cpp
@@ -2,6 +2,7 @@
 // Copyright (c) 2003-2005, Daniel Kristjansson 
 
 #include <cassert>
+#include <cstdlib>
 
 #include "mythcontext.h"
 #include "cc708decoder.h"
--- libs/libmythtv/eitscanner.cpp
+++ libs/libmythtv/eitscanner.cpp
@@ -4,6 +4,8 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 
+#include <cstdlib>
+
 #include "tv_rec.h"
 
 #include "channelbase.h"
--- libs/libmythtv/iptv/iptvfeederfile.cpp
+++ libs/libmythtv/iptv/iptvfeederfile.cpp
@@ -7,6 +7,7 @@
  *  Copyright (c) 2006 by Mike Mironov & Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "iptvfeederfile.h"
 
--- libs/libmythtv/iptv/iptvfeederrtp.cpp
+++ libs/libmythtv/iptv/iptvfeederrtp.cpp
@@ -3,6 +3,7 @@
  *  Copyright (c) 2006 by Mike Mironov & Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "iptvfeederrtp.h"
 
--- libs/libmythtv/iptv/iptvfeederrtsp.cpp
+++ libs/libmythtv/iptv/iptvfeederrtsp.cpp
@@ -3,6 +3,7 @@
  *  Copyright (c) 2006 by Laurent Arnal, Benjamin Lerman & Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "iptvfeederrtsp.h"
 
--- libs/libmythtv/iptv/iptvfeederudp.cpp
+++ libs/libmythtv/iptv/iptvfeederudp.cpp
@@ -3,6 +3,7 @@
  *  Copyright (c) 2006 by Mike Mironov & Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "iptvfeederudp.h"
 
--- libs/libmythtv/iptv/iptvfeederwrapper.cpp
+++ libs/libmythtv/iptv/iptvfeederwrapper.cpp
@@ -3,6 +3,7 @@
  *  Copyright (c) 2006 by Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "iptvfeederwrapper.h"
 
--- libs/libmythtv/iptv/iptvmediasink.cpp
+++ libs/libmythtv/iptv/iptvmediasink.cpp
@@ -3,6 +3,7 @@
  *  Copyright (c) 2006 by Laurent Arnal, Benjamin Lerman & Mickaël Remars
  *  Distributed as part of MythTV under GPL v2 and later.
  */
+#include <algorithm>
 
 #include "mythcontext.h"
 #include "iptvmediasink.h"
--- libs/libmythtv/jobqueue.cpp
+++ libs/libmythtv/jobqueue.cpp
@@ -12,6 +12,7 @@
 #include <sys/resource.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 #include "exitcodes.h"
--- libs/libmythtv/osdsurface.h
+++ libs/libmythtv/osdsurface.h
@@ -41,7 +41,7 @@
     void BlendToYV12(unsigned char *yptr,
                      unsigned char *uptr,
                      unsigned char *vptr,
-                     int ystride, int ystride, int vstride) const;
+                     int ystride, int ustride, int vstride) const;
     void BlendToARGB(unsigned char *argbptr,
                      uint stride, uint height, bool blendtoblack=false,
                      uint threshold = 0) const;
--- libs/libmythtv/programinfo.cpp
+++ libs/libmythtv/programinfo.cpp
@@ -10,6 +10,7 @@
 
 #include <sys/types.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #include "programinfo.h"
 #include "progdetails.h"
--- libs/libmythtv/util-xv.cpp
+++ libs/libmythtv/util-xv.cpp
@@ -3,6 +3,7 @@
 
 // C++ headers
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 // MythTH headers
--- libs/libmythtv/videodisplayprofile.cpp
+++ libs/libmythtv/videodisplayprofile.cpp
@@ -1,4 +1,5 @@
 // -*- Mode: c++ -*-
+#include <algorithm>
 
 #include "videodisplayprofile.h"
 #include "mythcontext.h"
--- libs/libmythtv/viewschdiff.cpp
+++ libs/libmythtv/viewschdiff.cpp
@@ -10,6 +10,7 @@
 #include <qheader.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 #include "viewschdiff.h"
--- libs/libmythtv/xbox.cpp
+++ libs/libmythtv/xbox.cpp
@@ -4,6 +4,7 @@
 #include "remoteutil.h"
 
 #include <unistd.h>
+#include <stdlib.h>
 
 XBox::XBox(void)
 {
--- libs/libmythtv/yuv2rgb.cpp
+++ libs/libmythtv/yuv2rgb.cpp
@@ -27,6 +27,7 @@
 #include <cstdlib>
 #include <algorithm>
 #include <inttypes.h>
+#include <limits.h>
 #include "config.h"
 
 #ifdef MMX
--- libs/libmythui/myththemedmenu.cpp
+++ libs/libmythui/myththemedmenu.cpp
@@ -4,6 +4,7 @@
 
 #include <iostream>
 #include <cmath>
+#include <cstdlib>
 using namespace std;
 
 #include "exitcodes.h"
--- libs/libmythui/mythuiimage.cpp
+++ libs/libmythui/mythuiimage.cpp
@@ -1,4 +1,5 @@
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 #include "mythuiimage.h"
--- libs/libmythui/xmlparsebase.cpp
+++ libs/libmythui/xmlparsebase.cpp
@@ -1,3 +1,5 @@
+#include <typeinfo>
+
 #include <qfile.h>
 
 #include "xmlparsebase.h"
--- libs/libmythupnp/httprequest.cpp
+++ libs/libmythupnp/httprequest.cpp
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <netinet/tcp.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 
 #include "util.h"
--- libs/libmythupnp/ssdp.cpp
+++ libs/libmythupnp/ssdp.cpp
@@ -19,6 +19,7 @@
 #include <qregexp.h>
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <qstringlist.h>
 #include <sys/time.h>
 
--- libs/libmythupnp/upnptasknotify.cpp
+++ libs/libmythupnp/upnptasknotify.cpp
@@ -13,6 +13,7 @@
 #include "broadcast.h"
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <qstringlist.h>
 #include <quuid.h> 
 #include <qdom.h> 
--- libs/libmythupnp/upnptasksearch.cpp
+++ libs/libmythupnp/upnptasksearch.cpp
@@ -12,6 +12,7 @@
 #include "upnptasksearch.h"
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <qstringlist.h>
 #include <quuid.h> 
 #include <qdom.h> 
--- libs/libmythupnp/upnputil.h
+++ libs/libmythupnp/upnputil.h
@@ -17,7 +17,7 @@
 
 // __suseconds_t doesn't exist on some older Unixes. e.g. Darwin/Mac OS X
 
-#if defined(__FreeBSD__) 
+#if defined(__FreeBSD__) || defined (__linux__)
 #define __suseconds_t_defined  // It exists on FreeBSD, but doesn't define this
 #endif
 
--- programs/mythbackend/housekeeper.cpp
+++ programs/mythbackend/housekeeper.cpp
@@ -10,6 +10,7 @@
 #include <qfileinfo.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 #include "housekeeper.h"
--- programs/mythbackend/httpstatus.cpp
+++ programs/mythbackend/httpstatus.cpp
@@ -22,6 +22,7 @@
 #include <qregexp.h>
 #include <qbuffer.h>
 #include <math.h>
+#include <stdlib.h>
 
 #include "../../config.h"
 #ifdef CONFIG_LMSENSORS 
--- programs/mythbackend/main.cpp
+++ programs/mythbackend/main.cpp
@@ -18,6 +18,7 @@
 
 #include <iostream>
 #include <fstream>
+#include <cstdlib>
 using namespace std;
 
 #include "tv_rec.h"
--- programs/mythcommflag/BlankFrameDetector.cpp
+++ programs/mythcommflag/BlankFrameDetector.cpp
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 
 #include "mythcontext.h"    /* gContext */
--- programs/mythcommflag/ClassicLogoDetector.cpp
+++ programs/mythcommflag/ClassicLogoDetector.cpp
@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <stdlib.h>
 
 #include "ClassicLogoDetector.h"
 #include "ClassicCommDetector.h"
--- programs/mythcommflag/EdgeDetector.cpp
+++ programs/mythcommflag/EdgeDetector.cpp
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "NuppelVideoPlayer.h"
 extern "C" {
 #include "avcodec.h"        // AVPicture
--- programs/mythcommflag/Histogram.cpp
+++ programs/mythcommflag/Histogram.cpp
@@ -1,6 +1,7 @@
 #include "Histogram.h"
 #include <string>
 #include <cmath>
+#include <cstring>
 
 Histogram::Histogram()
 {
--- programs/mythcommflag/SceneChangeDetector.cpp
+++ programs/mythcommflag/SceneChangeDetector.cpp
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 
 #include "mythcontext.h"    /* gContext */
--- programs/mythcommflag/TemplateFinder.cpp
+++ programs/mythcommflag/TemplateFinder.cpp
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <qfile.h>
 #include <qfileinfo.h>
 #include <math.h>
--- programs/mythcommflag/TemplateMatcher.cpp
+++ programs/mythcommflag/TemplateMatcher.cpp
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 
 #include "NuppelVideoPlayer.h"
--- programs/mythfilldatabase/channeldata.cpp
+++ programs/mythfilldatabase/channeldata.cpp
@@ -5,6 +5,7 @@
 
 // C++ headers
 #include <iostream>
+#include <cstdlib>
 
 // libmyth headers
 #include "mythcontext.h"
--- programs/mythfilldatabase/icondata.cpp
+++ programs/mythfilldatabase/icondata.cpp
@@ -11,6 +11,7 @@
 #include <qfileinfo.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 // libmyth headers
--- programs/mythfilldatabase/main.cpp
+++ programs/mythfilldatabase/main.cpp
@@ -3,6 +3,7 @@
 
 // C++ headers
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 // Qt headers
--- programs/mythfilldatabase/xmltvparser.cpp
+++ programs/mythfilldatabase/xmltvparser.cpp
@@ -5,6 +5,7 @@
 
 // C++ headers
 #include <iostream>
+#include <cstdlib>
 
 // libmyth headers
 #include "exitcodes.h"
--- programs/mythfrontend/main.cpp
+++ programs/mythfrontend/main.cpp
@@ -4,6 +4,7 @@
 #include <qfileinfo.h>
 #include <qmap.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <qdir.h>
 #include <qtextcodec.h>
 #include <qwidget.h>
--- programs/mythfrontend/playbackbox.cpp
+++ programs/mythfrontend/playbackbox.cpp
@@ -20,6 +20,7 @@
 
 #include <cmath>
 #include <unistd.h>
+#include <stdlib.h>
 
 #include <iostream>
 using namespace std;
--- programs/mythfrontend/statusbox.cpp
+++ programs/mythfrontend/statusbox.cpp
@@ -8,6 +8,7 @@
 #include <qhostaddress.h>
 
 #include <unistd.h>
+#include <stdlib.h>
 
 #include <iostream>
 #include <cerrno>
--- programs/mythfrontend/viewscheduled.cpp
+++ programs/mythfrontend/viewscheduled.cpp
@@ -9,6 +9,8 @@
 #include <qregexp.h>
 #include <qheader.h>
 
+#include <stdlib.h>
+
 #include <iostream>
 using namespace std;
 
--- programs/mythlcdserver/lcdprocclient.cpp
+++ programs/mythlcdserver/lcdprocclient.cpp
@@ -9,6 +9,7 @@
 #include <qapplication.h>
 #include <qregexp.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <cmath>
 
 #include "lcdprocclient.h"
--- programs/mythlcdserver/lcdserver.cpp
+++ programs/mythlcdserver/lcdserver.cpp
@@ -55,6 +55,7 @@
 
 */
 
+#include <stdlib.h>
 #include <qstringlist.h>
 #include <qregexp.h>
 #include <qdir.h>
--- programs/mythshutdown/main.cpp
+++ programs/mythshutdown/main.cpp
@@ -3,6 +3,7 @@
 #include <qtextstream.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 #include <unistd.h>
 
--- programs/mythtvosd/main.cpp
+++ programs/mythtvosd/main.cpp
@@ -3,6 +3,7 @@
 #include <sys/socket.h>
 
 #include <iostream>
+#include <cstdlib>
 
 #include <qapplication.h>
 #include <qsocketdevice.h>
--- programs/mythuitest/main.cpp
+++ programs/mythuitest/main.cpp
@@ -2,6 +2,7 @@
 #include <qsqldatabase.h>
 
 #include <iostream>
+#include <cstdlib>
 using namespace std;
 
 #include "mythmainwindow.h"
--- programs/mythwelcome/welcomedialog.cpp
+++ programs/mythwelcome/welcomedialog.cpp
@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <stdlib.h>
 #include <sys/wait.h>   // For WIFEXITED on Mac OS X
 
 // qt


More information about the mythtv-dev mailing list