views:

164

answers:

1

Am trying build pysqlite 2.5.3 package on SLSE 9, and am getting all sorts of compilation errors i.e.

...
src/module.c:290: error: initializer element is not constant
src/module.c:290: error: (near initialization for `_int_constants[27].constant_value')
src/module.c:290: error: initializer element is not constant
src/module.c:290: error: (near initialization for `_int_constants[27]')
src/module.c:291: error: `SQLITE_ATTACH' undeclared here (not in a function)
src/module.c:291: error: initializer element is not constant
src/module.c:291: error: (near initialization for `_int_constants[28].constant_value')
src/module.c:291: error: initializer element is not constant
src/module.c:291: error: (near initialization for `_int_constants[28]')
src/module.c:292: error: `SQLITE_DETACH' undeclared here (not in a function)
src/module.c:292: error: initializer element is not constant
src/module.c:292: error: (near initialization for `_int_constants[29].constant_value')
src/module.c:292: error: initializer element is not constant
src/module.c:292: error: (near initialization for `_int_constants[29]')
src/module.c:300: error: initializer element is not constant
src/module.c:300: error: (near initialization for `_int_constants[30]')
src/module.c: In function `init_sqlite':
src/module.c:419: warning: implicit declaration of function `sqlite3_libversion'
src/module.c:419: warning: passing arg 1 of `PyString_FromString' makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1

the things fails

this is my setup.cfg file:

[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=

SQLlite is running... when i do sqlite3, i get the command interface.

What am i missing out?

Gath

+4  A: 

Do you have the sqlite development headers installed?

error: SQLITE_DETACH' undeclared here

Looks like you need sqlite3-dev (or whatever your distro named it, perhaps sqlite3-devel?)

Edit:

After a good natured soul cleaned up your error trace a bit more, I'm quite sure you are missing the sqlite3 development headers. You have the library, just not the headers:

src/module.c:419: warning: implicit declaration of function `sqlite3_libversion'

If there is no header, there is no prototype. If there is no prototype, you'll see a warning complaining about an implicit declaration (if the compiler is set to issue sensible warnings).

Tim Post