c - Sqlite3 结构未在 Eclipse 中解析

标签 c eclipse eclipse-cdt

我是 Eclipse 中 c/c++ 的新手,尝试使用 sqlite 合并为 MATLAB 编写一些 sqlite 例程。

我遇到了这个问题,eclipse 似乎缺少一些基本 sqlite3 类型。 我在所有以 sqlite3* 作为输入的函数上收到“无效参数”错误。

例如在 sqlite3_close 我得到

Invalid arguments
Candidates are: int sqlite3_close(*)

正确的原型(prototype)是

int sqlite3_close(sqlite3*)

所有 sqlite3_stmt 类型都会出现同样的问题。 我已经包含了 sqlite3.h,它位于同一目录中,最后但并非最不重要的一点是,代码可以正常编译和运行。

我在这里错过了什么?

最佳答案

来自 sqlite3 代码,第 12450 行

** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
** is really a pointer to an instance of this structure.


 struct Vdbe {
    /*struct definition*/
}

也就是说,sqlite3_stmt 是一个forward declaration这会阻止用户创建 sqlite3_stmt 结构,而是使用 sqlite3 函数。

为了让 Eclipse CDT 识别 sqlite3_stmt,如果您不使用它进行编译,您可以将它作为一个符号添加到您的 Eclipse 项目属性中。

因为我不是,所以我将 sqlite3_stmt 定义为 Vdbe。

关于c - Sqlite3 结构未在 Eclipse 中解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20346754/

相关文章:

c - 成员 "Token"的 Yacc 错误请求不是结构或 union

Java 访问修饰符关键字(私有(private)、默认、 protected 、公共(public)或最终、静态等..)在 Eclipse 中自动隐藏,但在源文件中显示

c - shell后台进程

c - 在链表的头部插入一个新元素并打印元素值

java - 在 Eclipse Mars 中格式化 Java 代码的特定部分

c++ - 如何检查 makefile 中已定义符号(Eclipse-> 路径和符号)的值?

eclipse-cdt - 如何仅在 "Build project"上的 Eclipse CDT 中构建当前项目?

linux - 系统更新后 Eclipse CDT 索引器丢失

c - 删除C中字符串中的相邻重复项

eclipse - Eclipse不会在dropins文件夹中加载插件