Re: <gstmm.h> include errors



Murray Cumming wrote:
Did you touch all the .hg files?

Yes I did.

Again, when this test/example is in svn (or at least attached to an
email) I will happily investigate.

The example code is the following:

#include <iostream>
#include <gstmm.h>

using namespace std;

int main (int argc, char* argv[]) {
   Gst::init(argc, argv);

   Glib::RefPtr<Gst::Element> element =
       Gst::Element::create("fakesrc", "source");

   if (!element) {
       cout << "Failed to created gst element." << endl;
   }
}

I got gstreamermm from the svn link given to me by Milosz:

http://svn.beep-media-player.org/gstreamermm/trunk

I applied the attached patch in the top level directory to fix some things in autogen.sh (but this part is already in svn so just skip this part of the patch), the <gstmm.h> include file and a compile error I was getting reported in the following thread: http://mail.gnome.org/archives/gtkmm-list/2007-November/msg00114.html.

-Jose
Index: gst/gstmm.h
===================================================================
--- gst/gstmm.h	(revision 78)
+++ gst/gstmm.h	(working copy)
@@ -1,15 +1,15 @@
 #ifndef _GSTMM_H_
 #define _GSTMM_H_
 
-#include <gstmm/gstclock.h>
-#include <gstmm/gstelement.h>
-#include <gstmm/gsterror.h>
-#include <gstmm/gstformat.h>
-#include <gstmm/gstiterator.h>
-#include <gstmm/gstobject.h>
-#include <gstmm/gstpad.h>
-#include <gstmm/gststructure.h>
-#include <gstmm/gstsystemclock.h>
+#include <gstmm/clock.h>
+#include <gstmm/element.h>
+#include <gstmm/error.h>
+#include <gstmm/format.h>
+#include <gstmm/iterator.h>
+#include <gstmm/object.h>
+#include <gstmm/pad.h>
+#include <gstmm/structure.h>
+#include <gstmm/systemclock.h>
 
 #include <gstmm/init.h>
 #include <gstmm/wrap_init.h>
Index: tools/m4/convert_gst.m4
===================================================================
--- tools/m4/convert_gst.m4	(revision 78)
+++ tools/m4/convert_gst.m4	(working copy)
@@ -49,7 +49,7 @@
 _CONVERSION(`GstStructure*',`Structure*',`((Structure*) ($3))')
 _CONVERSION(`const Glib::RefPtr<Caps>&',`const GstCaps*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const xmlNodePtr&',`xmlNodePtr',`$3')
-_CONVERSION(`const va_list&',`va_list',`$3')
+_CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
 _CONVERSION(`GstBus*',`Glib::RefPtr<Bus>',`wrap($3)')
 
 _CONVERSION(`Format&',`GstFormat*',`(($2) &($3))')
Index: autogen.sh
===================================================================
--- autogen.sh	(revision 78)
+++ autogen.sh	(working copy)
@@ -1,6 +1,7 @@
 #! /bin/sh
 
 PKG_NAME=gstmm
+MIN_AUTOMAKE_VERSION=1.9
 
 srcdir=`dirname $0`
 test "x$srcdir" = x && srcdir=.
@@ -16,14 +17,31 @@
     exit 1
 fi
 
-(automake-1.9 --version) < /dev/null > /dev/null 2>&1 || {
-	echo
-	DIE=1
-	echo "You must have automake installed to compile gstmm."
-	echo "Download the appropriate package for your distribution,"
-	echo "or see http://www.gnu.org/software/automake";
-}
+# awk program to transform the output of automake --version
+# into an integer value suitable for numeric comparison (taken from gtkmm).
+extract_version='{ printf "%.0f", 1000000 * v[split($1, v, " ")] + 1000 * $2 + $3; exit }'
 
+min_automake_version=`echo "$MIN_AUTOMAKE_VERSION" | awk -F. "$extract_version"`
+
+for version in 1.9 ""
+do
+  automake_version=`automake${version:+-$version} --version < /dev/null 2>/dev/null | awk -F. "$extract_version"`
+  if test "$automake_version" -ge "$min_automake_version" 2>/dev/null
+  then
+    automake=automake${version:+-$version}
+    break;
+  fi
+done
+
+if [ "x$automake" == "x" ]
+then
+  echo
+  echo "You must have at least version 1.9 of automake installed"
+  echo "to compile gstmm.  Download the appropriate package for your"
+  echo "distribution, or see http://www.gnu.org/software/automake";
+  exit 1
+fi
+
 MAKE=`which gnumake`
 test -x "$MAKE" || MAKE=`which gmake`
 test -x "$MAKE" || MAKE=`which make`
@@ -49,7 +67,7 @@
 #autoheader
 
 echo "Building makefiles."
-automake --add-missing || exit 1
+$automake --add-missing || exit 1
 
 echo "Building configure."
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]