1

I'm baffled by this one.... SQLite is a separate project and part of a Workspace. When building the target, LLVM is complaining:

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

That's at line 44924 (and 14 other places following 44924). Here's what else I am seeing:

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: }

I also tried renaming the struct at 11378 to struct Btree_S (and changed the typedef). Same problem.

I guess my question is, how can it be incomplete? Any ideas?

jww
  • 97,681
  • 90
  • 411
  • 885
  • Try looking at the preprocessed source; the preprocessor can do strange things to source code. Also, if you're asking about a compiler diagnostic, please include the complete diagnostic output. – servn Nov 11 '12 at 04:40
  • Thanks @servn. I'm trying to clean up a reject, and I think its related to http://stackoverflow.com/questions/13327744/xcode-4-subproject-does-not-honor-inherited. I will get the output shortly. – jww Nov 11 '12 at 04:59
  • And what is at line 44924 in your version of `sqlite3.c`? – CL. Nov 11 '12 at 10:23
  • @CL - added the information. – jww Nov 11 '12 at 21:44

2 Answers2

2

Ensure that sqlite3.c is compiled as C, not C++.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • Thanks CL. I know how to bring up build settings, but how does one do that for a file (rather than project) in Xcode. I right click sqllite3.c and I get nothing after "Show File Inspector". – jww Nov 11 '12 at 23:02
  • Thanks CL. The points are yours since you suffered my mistake. – jww Nov 12 '12 at 03:24
0

Found the answer.... The preprocessor macro SQLITE_HAS_CODEC=1 was not defined. Why was it not defined? Because of Xcode 4: Project does not honor $(inherited) Build Setting in Workspace?.

$(inherited) does not work in Xcode 4 as expected across projects in a parent/child relationship (despite what the IDE's tree view shows us), and what the documentation implies about $(inherited).

Xcode configuration files (xcconfig) do not work as expected either. I could not get the configuration file assigned to other child projects (only the top level project).

Apple should fire their entire QA department and technical writers, and hire a new bunch of ID10Ts.

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885