Xcode (LLVM) 和 SQLite : error: incomplete definition of type 'struct Btree'

标签 xcode sqlite llvm

我对此感到困惑.... SQLite 是一个单独的项目,也是工作区的一部分。在构建目标时,LLVM 提示:

<path>/sqlite3.c:44924:24: Incomplete definition of type 'struct Btree'

那是在第 44924 行(以及 44924 之后的 14 个其他地方)。这是我看到的其他内容:
7145: /* Forward declaration */
7146: typedef struct Btree Btree;
...

11378: struct Btree {
11379:   sqlite3 *db;       /* The database connection holding this btree */
11380:   BtShared *pBt;     /* Sharable content of this btree */
11381:  u8 inTrans;        /* TRANS_NONE, TRANS_READ or TRANS_WRITE */
11382:  u8 sharable;       /* True if we can share pBt with another db */
11383:  u8 locked;         /* True if db currently has pBt locked */
11384:  int wantToLock;    /* Number of nested calls to sqlite3BtreeEnter() */
11385:  int nBackup;       /* Number of backup operations reading this btree */
11386:  Btree *pNext;      /* List of other sharable Btrees from the same db */
11387:  Btree *pPrev;      /* Back pointer of the same list */
11388:#ifndef SQLITE_OMIT_SHARED_CACHE
11389:  BtLock lock;       /* Object used to lock page 1 */
11390:#endif
11391:};
...

44919: static void lockBtreeMutex(Btree *p){
44920:   assert( p->locked==0 );
44921:   assert( sqlite3_mutex_notheld(p->pBt->mutex) );
44922:   assert( sqlite3_mutex_held(p->db->mutex) );
44923: 
44924:   sqlite3_mutex_enter(p->pBt->mutex);
44925:   p->pBt->db = p->db;
44926:   p->locked = 1;
44927: }

我还尝试将 11378 的结构重命名为 struct Btree_S (并更改了 typedef )。同样的问题。

我想我的问题是,它怎么可能不完整?有任何想法吗?

最佳答案

确保 sqlite3.c编译为 C,而不是 C++。

关于Xcode (LLVM) 和 SQLite : error: incomplete definition of type 'struct Btree' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13327058/

相关文章:

LLVM getBasicBlockIndex() 或等价物

ios - 权利不匹配 : Provisioning Profile Issue

ios - 为什么这个 View Controller 需要初始化器?

android - sqlite "DROP TABLE IF EXISTS"android中的错误

android - 如何访问小部件类中的 sqlite 数据库?

llvm - 我可以在 LLVM 中设置堆栈指针吗?

xcode - iOS SDK4.0 AVFoundation !

xcode - 如何在不影响单元测试目标的构建的情况下更改发布目标的名称?

c# - 客户端同步场景下实现SqliteClientSyncProvider?

clang - 如何为 Clang 添加 AVR 支持?