GStreamer GValue类型列表

时间:2016-09-27 16:51:32

标签: c hyperlink include gstreamer unresolved-external

我正在尝试使用Visual Studio 2013(v120)编译我的第一个GStreamer插件。但是当我尝试初始化GValue类型列表时

g_value_init (&va, GST_TYPE_LIST);

我得到了

error LNK2001: unresolved external symbol _gst_value_list_type

我发现_gst_value_list_type的定义与此类似

extern GType _gst_value_list_type;

/**
 * GST_TYPE_LIST:
 *
 * a #GValue type that represents an unordered list of #GValue values. This
 * is used for example to express a list of possible values for a field in
 * a caps structure, like a list of possible sample rates, of which only one
 * will be chosen in the end. This means that all values in the list are
 * meaningful on their own.
 *
 * Returns: the #GType of GstValueList (which is not explicitly typed)
 */
#define GST_TYPE_LIST                    (_gst_value_list_type)

但我不知道在哪里找到它

我有正确的头文件,我试图链接每个lib与gstreamers但没有任何成功。我正在使用从here

下载的gstreamer的最新版本

2 个答案:

答案 0 :(得分:0)

尝试加入

#include <gst/gstconfig.h>
#include <gst/gstcaps.h>
#include <gst/gststructure.h>
#include <gst/gstcapsfeatures.h>
#include <gst/gst.h>

一个接一个。请回答是否有帮助。

答案 1 :(得分:0)

我认为编译时,你的包含路径会看到不同的区域。

在我的情况下,我有两个gstreamer包含路径 (/usr/include/gstreamer-1.0和/usr/local/include/gstreamer-1.0)

在/usr/include/gstreamer-1.0中 GST_TYPE_LIST定义如下

#define GST_TYPE_LIST gst_value_list_get_type()

在/usr/local/include/gstreamer-1.0中 GST_TYPE_LIST定义如下

#define GST_TYPE_LIST (_gst_value_list_type)

将包含路径更改为/usr/include/gstreamer-1.0后,我解决了问题。