GStreamer C++ on Visual Studio 2010?

妖精的绣舞 提交于 2019-12-08 01:59:53

问题


Following instructions on http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows to install GStreamer and compile tutorials/examples on Windows 7, for compilation using Visual Studio 2010.

After installing the SDKs, I try to compile the "hello world" example...

Cannot open include file: 'gst/gst.h': No such file or directory.  

Odd - the tutorials were supposedly configured with the paths to these files. Nevertheless, we can manually add them...

Add C:\gstreamer-sdk\0.10\x86\include\gstreamer-0.10 to project include directories

Cannot open include file: 'glib.h': No such file or directory

Add C:\gstreamer-sdk\0.10\x86\include\glib-2.0 to project include directories

Cannot open include file: 'glibconfig.h': No such file or directory

At this point it seems to be a dead-end, as there isn't a glibconfig.h file anywhere on PC.

Was some step missing from the gstreamer documents?

p.s. I see a similar question, but its accepted answer seems to be a dead-link.


回答1:


(1) Install Windows Driver Development Kit

(2) When creating new projects, use the "gstreamer" template in Visual Studio, rather than the "Windows application" template. Then it doesn't need anything changing in the include/linker settings to make #include <gst/gst.h> work properly.




回答2:



This question was posted on 2014. However, for everyone that needs to install Gstreamer on Visual Studio , I am explaining how you configure your library on Windows.

First of you need to download the library from https://gstreamer.freedesktop.org/data/pkg/windows/


You need to download and install both installers for developers and non-developers.

For instance for 1.14 it is the now latest version,

**gstreamer-1.0-devel-x86-1.14.1.msi
gstreamer-1.0-x86-1.14.1.msi**<br>

You will install and setup both of them in the same directory like C:\gstreamer. (I guess gstreamer automatically adds its /bin to the Path environment. If not just ask it.)

After that you will open your Visual Studio. Create your C++ project. Create your main.cpp file. Right click on your project and click properties.

We need to do 3 Steps.

1)Include the necessary directory paths. 2) Define the where is the .lib paths. 3) Specify which .libs you want to use.

After clicking properties

1)

C/C++ -> Additional Include Directories -> define your include paths such as

C:\gstreamer\1.0\x86_64\lib\glib-2.0\include;C:\gstreamer\1.0\x86_64\include\gstreamer-1.0;C:\gstreamer\1.0\x86_64\include\glib-2.0\;C:\gstreamer\1.0\x86_64\include\glib-2.0\glib;%(AdditionalIncludeDirectories)

2)

Linker -> General -> Adding Library Directories -> write your lib directory path such as

C:\gstreamer\1.0\x86_64\lib;%(AdditionalLibraryDirectories)

3)

Linker -> Input -> Additional Dependencies -> Write your .lib files you want to use such as

**gobject-2.0.lib;glib-2.0.lib;gstreamer-1.0.lib;**kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

bold ones we added, others are done by default.



That's all. You can just write in your main.cpp file

'#include and use your Gstreamer Library'

I think will work for almost all libraries.




回答3:


The standard gstreamer installation on windows has a glibconfig.h located in: (assuming your gstreamer installation is in C:\gstreamer) C:\gstreamer\1.0\x86_64\lib\glib-2.0\include



来源:https://stackoverflow.com/questions/21265582/gstreamer-c-on-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!