Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用gstreamer时发生Eclipse无效参数错误_C++_C_Eclipse_Gstreamer_Invalid Argument - Fatal编程技术网

C++ 使用gstreamer时发生Eclipse无效参数错误

C++ 使用gstreamer时发生Eclipse无效参数错误,c++,c,eclipse,gstreamer,invalid-argument,C++,C,Eclipse,Gstreamer,Invalid Argument,好的,我想使用gstreamer库 1.处境 我有一些代码: #include <gst/gstpipeline.h> #include <gst/gst.h> ... GstElement* pipe = gst_pipeline_new("PipeName"); 在系统的某个地方定义了不明显的“事物”: typedef struct _GstElement GstElement; // gstelement.h typedef char

好的,我想使用gstreamer库

1.处境 我有一些代码:

#include <gst/gstpipeline.h>
#include <gst/gst.h>
...
GstElement* pipe = gst_pipeline_new("PipeName");
在系统的某个地方定义了不明显的“事物”:

typedef struct _GstElement GstElement;             // gstelement.h
typedef char   gchar;                              // gtypes.h
#define G_GNUC_MALLOC  __attribute__((__malloc__)) // gmacros.h
2.问题 因为我使用makeforbuilding,所以在编译和链接期间没有错误。程序本身运行正常。然而。。。 在Eclipse IDE中,我有以下错误:

Description Resource Path Location Type
Invalid arguments '
Candidates are:
_GstElement * gst_pipeline_new(const ? *)
' file.cc /path/to/file line 106 Semantic Error
我将Makefile中指定的所有include目录添加到eclipse项目配置中(项目->属性->C/C++常规->路径和符号->包含->C++)。当然,这是一个C++项目。 3.问题: 如何消除Eclipse错误?我不知道怎么做。。。这让我发疯,因为现在我使用一些遗留代码,我有大约100个类似这样的错误

到目前为止,我已经尝试:

  • 通过
    reinterpret_cast()
    或C型铸造到
    const gchar*
  • typedef char gchar
    添加到文件开头-在任何其他包含之前
  • 包括
    gtypes.h
    gchar
    )在任何其他包括之前
  • 重新说明“gst电子商务gst管道新(const gchar*名称)”
帮助过我的人中的尼瑟


在我看来,Eclipse似乎没有看到
gchar
类型,因为它说候选对象是
\u GstElement*gst\u pipeline\u new(const?*)
,其中
替代了实际类型。但是我不知道如何制作(或事件强制:)Eclipse来查看它…

很可能Eclipse只是不知道您的include路径(对于这个特定的库),并且抱怨没有索引的类型和声明

您可以在“项目->属性->C++常规->路径和符号”下添加它们


如果这不起作用,您还可以关闭语义错误检查(请参阅代码分析),无论是整个错误检查还是特定的错误类型检查。

正如g-maulik所建议的,这似乎确实是索引器的问题。增加索引器缓存限制后,一切正常

转到窗口->首选项->C/C++->索引器选项卡缓存限制和增加(可能取决于机器):


问题是我已经这么做了,错误仍然存在。。。我甚至包括了
gtypes.h
——包含
gchar
定义的文件,但它没有帮助。有时索引器无法正确获取内容。您可以尝试重新编制项目的索引,但如果这没有帮助,我只会忽略这个“错误”(因为它不是您提到的真实错误),特别是我不会开始更改已经编译和运行的代码来摆脱它。
Description Resource Path Location Type
Invalid arguments '
Candidates are:
_GstElement * gst_pipeline_new(const ? *)
' file.cc /path/to/file line 106 Semantic Error
Index Database cache:
Limit relative to the maximum heap size: 15%
Absolute limit: 128 MB

Header file cache:
Absolute Limit: 128 MB