From: George Trojan on
During installation of MySQL-python-1.2.3c1 I encountered the following

$ python2.6 build
running build
running build_py
copying MySQLdb/ -> build/lib.linux-x86_64-2.6/MySQLdb
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'gamma',1)
-D__version__=1.2.3c1 -I/usr/include/mysql
-I/usr/local/Python-2.6.3/include/python2.6 -c _mysql.c -o
build/temp.linux-x86_64-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-fno-strict-aliasing -fwrapv
gcc -pthread -shared build/temp.linux-x86_64-2.6/_mysql.o
-L/usr/lib64/mysql -L/usr/lib64 -L. -lmysqlclient_r -lz -lpthread
-lcrypt -lnsl -lm -lpthread -lssl -lcrypto -lpython2.6 -o
/usr/bin/ld: cannot find -lpython2.6
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Linker could not find Note that the compiler *did* find
Python include file: -I/usr/local/Python-2.6.3/include/python2.6.
I am running CentOS5.3. Python 2.6 was configured as follows:

$ TARGET=/usr/local/Python-2.6.3
$ export LDFLAGS=-Wl,-rpath,$TARGET/lib
$ ./configure --prefix=$TARGET \
--with-cxx=g++ --with-threads --enable-shared

to avoid messing with LD_LIBRARY_PATH.
I managed to complete the installation by pasting the above link command
and adding proper -L option, but I would like to know what would be
the proper fix.