在 Ubuntu 10.04 上为 odbc 编译 LuaSQL 2.1.1

发布于 2024-10-05 22:48:02 字数 3296 浏览 3 评论 0原文

我无法让 luasql 2.1.1 for odbc 进行开箱即用的编译,并且我不明白如何解释该错误。这是在Ubuntu 10.04上,unixodbc安装成功。

root@server:~/Downloads/luasql-2.1.1# make
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include    -c -o src/luasql.o src/luasql.c
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include    -c -o src/ls_odbc.o src/ls_odbc.c
src/ls_odbc.c: In function ‘fail’:
src/ls_odbc.c:134: warning: pointer targets in passing argument 6 of ‘SQLGetDiagRec’ differ in signedness
/usr/include/sql.h:708: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c: In function ‘push_column’:
src/ls_odbc.c:197: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:210: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:230: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:245: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c: In function ‘create_colinfo’:
src/ls_odbc.c:383: warning: pointer targets in passing argument 2 of ‘lua_pushstring’ differ in signedness
/usr/local/include/lua.h:164: note: expected ‘const char *’ but argument is of type ‘SQLCHAR *’
src/ls_odbc.c: In function ‘conn_execute’:
src/ls_odbc.c:468: warning: pointer targets in passing argument 2 of ‘SQLPrepare’ differ in signedness
/usr/include/sql.h:743: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:497: warning: passing argument 2 of ‘SQLRowCount’ from incompatible pointer type
/usr/include/sql.h:749: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c: In function ‘env_connect’:
src/ls_odbc.c:602: warning: pointer targets in passing argument 2 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:602: warning: pointer targets in passing argument 4 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:602: warning: pointer targets in passing argument 6 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include  -o src/odbc.so -shared  src/luasql.o src/ls_odbc.o  -L/usr/local/lib -lodbc
/usr/bin/ld: src/luasql.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
src/luasql.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [src/odbc.so] Error 1

I can't get luasql 2.1.1 for odbc to compile out of the box, and I don't understand how to interpret the error. This is on Ubuntu 10.04, and unixodbc is successfully installed.

root@server:~/Downloads/luasql-2.1.1# make
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include    -c -o src/luasql.o src/luasql.c
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include    -c -o src/ls_odbc.o src/ls_odbc.c
src/ls_odbc.c: In function ‘fail’:
src/ls_odbc.c:134: warning: pointer targets in passing argument 6 of ‘SQLGetDiagRec’ differ in signedness
/usr/include/sql.h:708: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c: In function ‘push_column’:
src/ls_odbc.c:197: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:210: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:230: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c:245: warning: passing argument 6 of ‘SQLGetData’ from incompatible pointer type
/usr/include/sql.h:685: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c: In function ‘create_colinfo’:
src/ls_odbc.c:383: warning: pointer targets in passing argument 2 of ‘lua_pushstring’ differ in signedness
/usr/local/include/lua.h:164: note: expected ‘const char *’ but argument is of type ‘SQLCHAR *’
src/ls_odbc.c: In function ‘conn_execute’:
src/ls_odbc.c:468: warning: pointer targets in passing argument 2 of ‘SQLPrepare’ differ in signedness
/usr/include/sql.h:743: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:497: warning: passing argument 2 of ‘SQLRowCount’ from incompatible pointer type
/usr/include/sql.h:749: note: expected ‘SQLLEN *’ but argument is of type ‘SQLINTEGER *’
src/ls_odbc.c: In function ‘env_connect’:
src/ls_odbc.c:602: warning: pointer targets in passing argument 2 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:602: warning: pointer targets in passing argument 4 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
src/ls_odbc.c:602: warning: pointer targets in passing argument 6 of ‘SQLConnect’ differ in signedness
/usr/include/sql.h:614: note: expected ‘SQLCHAR *’ but argument is of type ‘char *’
export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic -I../compat/src -DUNIXODBC -I/usr/local/include -I/usr/local/include  -o src/odbc.so -shared  src/luasql.o src/ls_odbc.o  -L/usr/local/lib -lodbc
/usr/bin/ld: src/luasql.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
src/luasql.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [src/odbc.so] Error 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殤城〤 2024-10-12 22:48:02

通过按照 luasql-2.x/config 中的 WARN 变量中的建议添加 -fPIC 标志来修复此问题。谢谢!

Fixed it by adding the -fPIC flag as suggested in the WARN variable in luasql-2.x/config. Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文