Menu

ld cannot find file "-lz" when building

Help
2005-05-12
2012-09-19
  • mike malone

    mike malone - 2005-05-12

    I am running:
    Redhat 9
    gcc-3.2.2-5
    python-2.4.1
    MySQL 3.23.58

    I have fixed the quote ' ' problems due to having an old version of MySQL, but now the linker is giving me problems:


    unning build
    running build_py
    running build_ext
    building '_mysql' extension
    gcc -pthread -shared build/temp.linux-i686-2.4/_mysql.o -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lmysqlclient -o build/lib.linux-i686-2.4/_mysql.so
    /usr/bin/ld: cannot find -lz
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1


    It thinks the argument '-lz' is supposed to be a file, I think. Does anyone know how I can fix this? Please.
    -Mike

     
    • mike malone

      mike malone - 2005-05-13

      Andy,
      You were right on- I was missing zlib-devel. It is probably pretty obvious how new I am at this. I cannot tell you how thankful I am for the direction. It can be rough trying to determine all the dependencies for someone who is new, and you saved me hours of frustration.

      Thanks-
      Mike

       
    • Andy Dustman

      Andy Dustman - 2005-05-12

      Well at least you read the bugs or the forums before posting...

      1.2.1c3 did not fix this problem. After working through it with someone today, I've come to the conclusion that MySQL older than 4.0.16 does not support mysql_config --include. However, the include path is also included in --cflags, so I can pull it out of there. Hopefully I can put this problem to rest tonight.

      You might have a different problem, though: Make sure you have zlib-devel installed on your system.

       

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.