gcc -shared build/temp.linux-i686-2.2/_mysql.o -lmysqlclient -lz -lcrypt -lnsl -
lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv] -lmysq
lclient_r -o build/lib.linux-i686-2.2/_mysql.so
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
<end session transcript>
-lmysqlclient did not turn up any search results on this forum.
I've patched setup.py as follows
#'download_url': "http://prdownloads.sourceforge.net/mysql-python/" \
# "MySQL-python-%s.tar.gz" % version,
#'classifiers': [ c for c in classifiers.split('\n') if c ],
I copied the header files to the build directory (/georges/download/MySQL-python-1.2.0/).
This system is RH 9 with MySQL 3.23.54 and python 2.2.2.
Thanks for your help,
George
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try 1.2.0c3. There is obviously a problem with your mysql_config implementation, and c3 has a workaround. Notice the right bracket (]) in the link line.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You apparently don't have the thread-safe library (libmysqlclient_r).
The following is straight out of README:
Building and installing
The setup.py script uses mysql_config to find all compiler and linker
options, and should work as is on any POSIX-like platform, so long as
mysql_config is in your path.
Depending on which version of MySQL you have, you may have the option
of using three different client libraries:
mysqlclient
mostly but not guaranteed thread-safe
mysqlclient_r
thread-safe, use if you can
mysqld
embedded server
mysqlclient_r is used by default. To use one of the others, set
the environment variable mysqlclient to the name of the library
you want to use. In a Bourne-style shell, use::
$ exportmysqlclient=mysqlclient
Only do this if you don't have the thread-safe library (mysqlclient_r)
or you want to use the embedded server (mysqld).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get this error when trying to build:
gcc -shared build/temp.linux-i686-2.2/_mysql.o -lmysqlclient -lz -lcrypt -lnsl -
lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv] -lmysq
lclient_r -o build/lib.linux-i686-2.2/_mysql.so
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
<end session transcript>
-lmysqlclient did not turn up any search results on this forum.
I've patched setup.py as follows
#'download_url': "http://prdownloads.sourceforge.net/mysql-python/" \ # "MySQL-python-%s.tar.gz" % version,
#'classifiers': [ c for c in classifiers.split('\n') if c ],
I copied the header files to the build directory (/georges/download/MySQL-python-1.2.0/).
This system is RH 9 with MySQL 3.23.54 and python 2.2.2.
Thanks for your help,
George
Worked like a charm,
thanks so much,
George
Try 1.2.0c3. There is obviously a problem with your mysql_config implementation, and c3 has a workaround. Notice the right bracket (]) in the link line.
Thanks for responding.
I tried 1.2.1c3 (couldn't find a file for 1.2.0c3 on SourceForge).
I had to do the same alterations to setup.py & copy the header files to the installation directory again, and arrived at the same error:
building '_mysql' extension
gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.2 -c _mysql.c -o build/temp.linux-i686-2.2/_mysql.o -I'/usr/include/mysql'
gcc -shared build/temp.linux-i686-2.2/_mysql.o -lz -lmysqlclient_r -o build/lib.linux-i686-2.2/_mysql.so
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Sorry to trouble you with this, but I have no idea what -lmysqlclient_r is to try to get the installation to proceed.
Thanks again,
George
You apparently don't have the thread-safe library (libmysqlclient_r).
The following is straight out of README:
Building and installing
The setup.py script uses mysql_config to find all compiler and linker
options, and should work as is on any POSIX-like platform, so long as
mysql_config is in your path.
Depending on which version of MySQL you have, you may have the option
of using three different client libraries:
mysqlclient
mostly but not guaranteed thread-safe
mysqlclient_r
thread-safe, use if you can
mysqld
embedded server
mysqlclient_r is used by default. To use one of the others, set
the environment variable mysqlclient to the name of the library
you want to use. In a Bourne-style shell, use::
Only do this if you don't have the thread-safe library (mysqlclient_r)
or you want to use the embedded server (mysqld).