Gstreamer and C/C++ dev


 
Thread Tools Search this Thread
Top Forums Programming Gstreamer and C/C++ dev
# 1  
Old 03-25-2010
Gstreamer and C/C++ dev

Hi
I wrote a simple C code with gstreamer libs( gstreamer example code manual ref )
On my ubuntu linux, the gstreamer headers are inside /usr/include/gstreamer-0.10/gst
Inside my C code I wrote:

#include <stdlib.h>
#include <gstreamer-0.10/gst/gst.h>
....
....
I have this error: there are unresolved includes inside <gstreamer-0.10/gst/gst.h>


inside gstreamer-0.10/gst/gst.h I find:
#include <glib.h>
#include <gst/glib-compat.h>
#include <gst/gstenumtypes.h>
#include <gst/gstversion.h>
#include <gst/gstbin.h>
#include <gst/gstbuffer.h>
#include <gst/gstbufferlist.h>
#include <gst/gstcaps.h>

....
....
But On my ubuntu I have

/usr/include/glib-2.0/glib.h

/usr/include/gstreamer-0.10/gst/gst.h
/usr/include/gstreamer-0.10/gst/gstenumtypes.h


How to solve the problem? I thank you...


Sorry for my english...it's no good
# 2  
Old 03-25-2010
Assuming you're using gcc, you can specify extra include directories with -I<path>, e.g:

Code:
gcc -I/usr/include/gstreamer-0.10

tells the compiler to look in /usr/include/gstreamer-0.10.

You should probably include -I/usr/include/gstreamer-0.10 and -I/usr/include/glib-2.0, and then #include <gst/gst.h> in your source file. That way, you can use new versions of the headers by just changing the -I flags on your command line.

John G
# 3  
Old 03-25-2010
Ok...thanks....

I used -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/include/libxml2 -I/usr/lib/glib-2.0/include and now the code is ok

I have two small errors:
undefined reference to `gst_init'
undefined reference to `gst_version'

Example gstreamer manual ref code :
Code:
const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, &micro, &nano);

If I delete these two lines, the code is successfully constructed
what is the problem?
# 4  
Old 03-25-2010
Quote:
Originally Posted by takeo.kikuta
Code:
const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, &micro, &nano);

If I delete these two lines, the code is successfully constructed
what is the problem?
These are linker errors - you need to link with the pre-compiled gstreamer library. This means you need to find where that library is and, if it's not in a standard directory like /lib/ or /usr/lib/, pass that as an -L option to specify the library directory to gcc, much like you did with -I (uppercase 'i'), and then you need to pass an -l (lowercase 'L') option, e.g. the following:

Code:
gcc -L/usr/lib/gstreamer-0.10/ -lgstreamer

Will tell gcc to look for library files in /usr/lib/gstreamer-0.10/, and will look for libgstreamer.so.

I don't know if you'll want to use -lgstreamer, you'll have to find out from their documentation.
# 5  
Old 03-25-2010
Ok thanks....

Build successful
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. HP-UX

Dev/urandom and dev/random missing in HP-UX

Hi, In our HP-UX B.11.11. I could not find dev/urandom and dev/random Are all pseudo-devices implemented as device drivers, or in need to run /configure some package to install the package to have dev/urandom. Please help (4 Replies)
Discussion started by: rashi
4 Replies

2. Red Hat

Changing grub from /dev/sda to /dev/sdb

Hi, Please suggest steps to change grub from /dev/sda to /dev/sdb, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

3. Shell Programming and Scripting

Automating partitioning setup of /dev/sda on /dev/sdc

Objective: To recreate the partitioning setup of /dev/sda on /dev/sdc How would I parse the below information and initialize variables (an array?) that can be used to build sgdisk commands in a script, regardless of the number of partitions? Something along the lines of: sgdisk -n... (12 Replies)
Discussion started by: RogerBaran
12 Replies

4. AIX

Problem in /dev/hd1 and /dev/hd9var

Hello AIXians, I can't boot my AIX, it hangs and stops at the code error: 0518 After searching google, I knew the problem is due to problems in File Systems. So the solution is booting from any bootable media, then run these commands in maintenance mode: #fsck -y /dev/hd4 #fsck -y... (3 Replies)
Discussion started by: Mohannad
3 Replies

5. AIX

Difference between /dev/hdisk and /dev/rhdisk

Hi, How can i check that i am using RAW devices for storage in my AIX machine... Also after adding a LUN from storage to a aix host, when i check /dev in the host, i can see both rhdisk and hdisk with same number eg: dcback1(root):/dev>ls -lrt | grep disk12 crw------- 1 root ... (4 Replies)
Discussion started by: jibujacob
4 Replies

6. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

7. Red Hat

Install gstreamer on red hat

hello, i have downloaded the gstreamer from following location Index of /pkg/redhat/9/i386/SRPMS.gst and i placed in the root/Zoom directory. now i want to install that on my system so that i can devolop some gstreamer related applications and run it. now how i need to install it on my... (0 Replies)
Discussion started by: juststarted
0 Replies

8. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies
Login or Register to Ask a Question