我在SLSE 9上尝试构建pysqlite 2.5.3软件包,并且遇到各种编译错误,即
...
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
事情失败
这是我的setup.cfg文件:
[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=
SQLlite正在运行...当我执行sqlite3时,我得到命令界面。
我错过了什么?
加特
答案 0 :(得分:4)
您是否安装了sqlite开发标题?
错误:SQLITE_DETACH'未声明此处
看起来你需要sqlite3-dev(或者你的发行版命名它,也许是sqlite3-devel?)
修改强>
在一个善良的灵魂清理了你的错误跟踪之后,我很确定你错过了sqlite3开发标题。你有图书馆,而不是标题:
src / module.c:419:警告:隐含 功能声明 `sqlite3_libversion'
如果没有标题,则没有原型。如果没有原型,你会看到一个抱怨隐含声明的警告(如果编译器设置为发出合理的警告)。