繁体   English   中英

SQLite 不完整类型错误

[英]SQLite Incomplete Type Error

我正在编写一个使用 SQLite 作为数据库的 C++ 程序。 对于这行代码;

void testRun()
{
    // some code here

    sqlite3_stmt stmt;

    // some code here too
}

我收到以下错误;

error: aggregate 'sqlite3_stmt stmt' has incomplete type and cannot be defined
     sqlite3_stmt stmt;
                  ^

我正在使用合并的 SQLite 源代码并包含“sqlite3.h”。 究竟是什么导致了这个错误,如何解决? 我在 Windows 7 64 位上,使用 MinGW_64。

这是一个只有实现才知道的不透明结构。 你不能创建它的一个实例,但你可以创建一个指向一个的指针:

sqlite3_stmt* stmt;
sqlite3_prepare(db, "SELECT...", -1, &stmt, 0);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM