开发者

mysql-python static linking on Linux 64-bit

开发者 https://www.devze.com 2022-12-16 00:36 出处:网络
Has anyone tried to statically link mysql-python with mysql client library on 64-bit Linux? gcc -pthread -shared build/temp.linux-x86_64-2.6/_mysql.o /home/apy/MySQL-

Has anyone tried to statically link mysql-python with mysql client library on 64-bit Linux?

gcc -pthread -shared build/temp.linux-x86_64-2.6/_mysql.o /home/apy/MySQL-
python-1.2.3c1/mysql-5.1.42/i/lib/mysql/libmysqlclient_r.a -L/home/apy/MyS
QL-python-1.2.3c1/mysql-5.1.42/i/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -
lm -lpthread -o build/lib.linux-x86_64-2.6/_mysql.so
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: /home/a
py/MySQL-python-1.2.3c1/mysql-5.1.42/i/lib/mysql/libmysqlclient_r.a(libmys
ql.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a sha
red object; recompile with -fPIC
/home/apy/MySQL-python-1.2.3开发者_如何学JAVAc1/mysql-5.1.42/i/lib/mysql/libmysqlclient_r.a: could not read symbols: Bad value

See also: mysql-python: building a completely standalone _mysql.so on Mac OS X?


  1. Set CFLAGS="-fPIC" environment variable. (reason)

  2. Pass --disable-shared to ./configure (besides --enable-static, that is) when building mysql.

0

精彩评论

暂无评论...
验证码 换一张
取 消