问题描述
遵循http://docs.gstreamer.com/display/GstSDK /Installing + on + Windows 即可安装GStreamer并在Windows 7上编译教程/示例,以使用Visual Studio 2010进行编译.
安装SDK之后,我尝试编译"hello world"示例...
Cannot open include file: 'gst/gst.h': No such file or directory.
奇数-假定教程已配置了这些文件的路径.不过,我们可以手动添加它们...
将C:\ gstreamer-sdk \ 0.10 \ x86 \ include \ gstreamer-0.10添加到项目包含目录中
Cannot open include file: 'glib.h': No such file or directory
将C:\ gstreamer-sdk \ 0.10 \ x86 \ include \ glib-2.0添加到项目包含目录中
Cannot open include file: 'glibconfig.h': No such file or directory
这似乎是一个死胡同,因为PC上没有glibconfig.h文件.
gstreamer文档缺少某些步骤吗?
p.s.我看到类似的问题,但是它的可接受答案似乎成为死链接.
此问题发布于2014年.但是,对于需要在Visual Studio上安装Gstreamer的每个人,我正在解释如何在Windows上配置您的库.
首先,您需要从 https://gstreamer.freedesktop.org下载该库. /data/pkg/windows/
您需要下载并安装面向开发人员和非开发人员的安装程序.
例如对于1.14,它是最新版本,
- gstreamer-1.0-devel-x86-1.14.1.msi
- gstreamer-1.0-x86-1.14.1.msi
您将在相同的目录(如C:\gstreamer
)中安装和设置它们. (我猜gstreamer会自动将其/bin
添加到Path环境中.
然后,您将打开Visual Studio.创建您的C ++项目.创建您的main.cpp
文件.右键单击您的项目,然后单击属性.
我们需要执行3个步骤:
- 包括必要的目录路径.
- 定义
.lib
路径的位置. - 指定要使用的
.libs
.
点击属性后:
- C/C ++->其他包含目录->定义包含路径,例如
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)
- 链接器->常规->添加库目录->编写lib目录路径,例如
C:\gstreamer\1.0\x86_64\lib;%(AdditionalLibraryDirectories)
- 链接器->输入->其他依赖关系->编写您要使用的.lib文件,例如
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)
gobject-2.0.lib;glib-2.0.lib;gstreamer-1.0.lib
是我们添加的内容,其他默认情况下是完成的.
仅此而已.您可以只写您的main.cpp
文件
#include <gst/gst.h>
并使用您的GStreamer库
我认为这几乎适用于所有库.
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.
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
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:
- Include the necessary directory paths.
- Define the where the
.lib
paths are. - Specify which
.libs
you want to use.
After clicking properties:
- 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)
- Linker -> General -> Adding Library Directories -> write your lib directory path such as
C:\gstreamer\1.0\x86_64\lib;%(AdditionalLibraryDirectories)
- 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)
gobject-2.0.lib;glib-2.0.lib;gstreamer-1.0.lib
are the ones we added, others are done by default.
That's all. You can just write in your main.cpp
file
#include <gst/gst.h>
and use your GStreamer Library
I think this will work for almost all libraries.
这篇关于在Visual Studio 2010上使用GStreamer C ++吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!