Menu

Multiple Installation Problems

Help
ggpauly
2005-09-01
2012-09-19
  • ggpauly

    ggpauly - 2005-09-01

    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

     
    • ggpauly

      ggpauly - 2005-09-02

      Worked like a charm,

      thanks so much,

      George

       
    • Andy Dustman

      Andy Dustman - 2005-09-01

      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.

       
    • ggpauly

      ggpauly - 2005-09-02

      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

       
      • Andy Dustman

        Andy Dustman - 2005-09-02

        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::

        $ export mysqlclient=mysqlclient
        

        Only do this if you don't have the thread-safe library (mysqlclient_r)
        or you want to use the embedded server (mysqld).

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.