So I'm having some trouble compiling programs with "gst/gst.h" in them.
Here's where I'm having trouble:
- I downloaded and installed gstreamer from AlexT's repo.
- I then compile my program saying
libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-1.0` -o main main.c
I get the following message:
Package gstreamer-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-1.0' found
libtool: link: gcc -o main main.c
main.c:3:21: fatal error: gst/gst.h: No such file or directory
I'm not sure how to solve this. I understand I come off as a bit of a noob but I'm super new to even Linux in general.
Did you install gstreamer1.0 from AlexT's repo by running opkg install gstreamer1.0?
Which is the location of gst.h in your board? I installed the package using opkg and the location in my board is /usr/include/gstreamer-1.0/gst/. This means that the line # include "gst/gst.h" will not work and you should change it to # include "gstreamer-1.0/gst/gst.h". The problem is that the gst.h file uses # include and glib.h is not in /usr/include/ is in /usr/include/glib-2.0/
If you want to use the gst.h library you have to know that there could be some conflicts in the location of the different libraries, some alternatives that comes to my mind are:
1. Get the linkers and flags to compile the code setting the specific location of the libraries
2. Change the files. A specific code could work but in the future if you are going to work with the same libraries you may need to do the same thing and could give you a lot of problems
3. Add the GStreamer package in the image by building a custom one, doing this there may be some improvements in the location of the different libraries. I haven't tried this but it could work.
I hope this gives you an idea on how to start.
Thanks for the quick response CMata_Intel I've installed from AlexT's repo and just to confirm, when i run opkg install gstreamer1.0, it says "Package installed in root is up to date".
BUT in /usr/include I don't see a gstreamer1.0 folder like you describe. What do you think is going on?
Also: Do I really need to install gstreamer from ALexT's repo given that I was already able to play stuff from the command line using gst-launch-1.0?
Run the commands opkg install gstreamer1.0
No, it is not necessary. Actually the message "Package installed in root is up to date" is due to having the package already installed, as you said, the package is working fine but the problem is only while using the headers. After installing the gstreamer1.0-dev you should be able to see the files in /usr/include/gstreamer-1.0