Bug #32507 Compiling MySQL 5 Community returns errors I don't understand
Submitted: 19 Nov 2007 21:27 Modified: 26 Apr 2018 14:01
Reporter: Rebecca Fine Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.0.45 OS:Linux (Debian 4.0)
Assigned to: CPU Architecture:Any
Tags: community, compile, Debian, debian 4, debian etch, error, fatal errors, make, Mysql 5

[19 Nov 2007 21:27] Rebecca Fine
Description:
I configured MySQL on my VPS with some difficulty, using the manual and beginner's luck to succeed there. But now, when I type `make', I get all these errors. I thought maybe the block of output before the errors would be useful to solving the problem, so I copy-pasted that, too.

Also, I just reinstalled Apache 2.2.6 and PHP 5.2, and they were giving me a bit of a hard time, too.

This is a VPS, and a live server, so I hope this can be fixed as soon as possible.

/bin/sh ../libtool --preserve-dup-deps --tag=CXX --mode=link g++  -O3 -DDBUG_OFF    -fno-implicit-templates -fno-exceptions -fno-rtti  -rdynamic  -o mysql  mysql.o readline.o sql_string.o completion_hash.o ../cmd-line-utils/libedit/libedit.a -lncurses ../libmysql/libmysqlclient.la  -lcrypt -lnsl -lm  -L/usr/local/ssl//lib -lssl -lcrypto -lz
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o .libs/mysql mysql.o readline.o sql_string.o completion_hash.o  ../cmd-line-utils/libedit/libedit.a -lncurses ../libmysql/.libs/libmysqlclient.so -L/usr/local/ssl//lib -lcrypt -lnsl -lm -lssl -lcrypto -lz -Wl,--rpath -Wl,/usr/local/lib/mysql
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlerror'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlclose'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlopen'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
make[2]: *** [mysql] Error 1
make[2]: Leaving directory `/mysql/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mysql'
make: *** [all] Error 2

How to repeat:
Compile with 'make', before 'make install' is run.
[19 Nov 2007 21:56] Sveta Smirnova
Thank you for the report.

But version 5.0.27 is quite old. Please upgrade to current version 5.0.45, try with it and say us result.

Also is better to use:

./BUILD/autorun.sh && ./configure && make

or

./BUILD/compile-* scripts
[19 Nov 2007 22:22] Rebecca Fine
I downloaded MySQL Community 5.0.45, I had just forgotten and guessed at the version, foolishly. But I tried again and got the same errors. Any ideas?
[20 Nov 2007 7:07] Hartmut Holzgraefe
Looks like some leftovers from previous compile runs with different configure settings to me.

Please try a "make clean; make" instead of just "make" or even better start from scratch with a freshly unpacked source directory
[20 Nov 2007 12:14] Rebecca Fine
I tried that, but got the same error. Could it be anything else?
[20 Nov 2007 12:16] Rebecca Fine
Also, I want to thank you two and anyone else who wants to help fix this. I really appreciate it. Thanks!
[20 Nov 2007 15:46] Valeriy Kravchuk
Please, send the versions of gcc and make utilities used. Send the results of

echo $LD_LIBRARY_PATH

also.
[24 Nov 2007 13:43] Rebecca Fine
I'm not sure how to find the version numbers for those two, but I'll get you the answer to your other question right away.
[24 Nov 2007 13:46] Rebecca Fine
Um, this is odd. The output of echo $LD_LIBRARY_PATH was a blank, empty line. I bet that's not much help... sorry about that.
[24 Nov 2007 13:50] Rebecca Fine
3rd email in a row, I don't mean to triple-post, but I just found out how to tell the version of make, and will try that with gcc.

Make 3.81
GCC 4.1.2

Hope this helps, thanks!
[30 Nov 2007 11:48] Sveta Smirnova
Thank you for the feedback.

Have you runned ./BUILD/autorun.sh before ./configure? If haven't, please do it now and if you still get errors provide versions of automake, autoconf, libtool, m4 and bison
[1 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[7 Jan 2008 13:19] Susanne Ebrecht
Rebecca,

we still need the feedback from you.
[8 Feb 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[25 Feb 2008 23:20] Luis Rodrigo Ortiz
Hi i have the same error if you  contact me maybe can feedback more info for solve it
[26 Feb 2008 20:18] Sveta Smirnova
Luis,

thank you for the feedback.

Have you runned ./BUILD/autorun.sh before ./configure? If haven't, please do it now and if you still get errors provide versions of automake, autoconf, libtool, m4 and bison
[27 Feb 2008 14:16] Rebecca Fine
I'm sorry, I've since used the 5.0.51 Debian build from APT. I wish I could help...
[29 Feb 2008 21:19] Sveta Smirnova
Rebecca,

not a problem. This looks like just not follow up all required steps of compiling, but not a bug for me anyway. But as Luis has similar problems we have to try to get all necessary information to be sure. So it mostly in "Need feedback" from Luis status now.
[30 Mar 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[19 Sep 2008 10:13] metron native
OK, Thats far so long thx for help but but it want work!

/BUILD/automake.sh shows me what i just have to install first before i run configure. Now the result is the same. SRY it doesnt work. Same Error same Error Mesage:

g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o .libs/mysqladmin mysqladmin.o  ../libmysql/.libs/libmysqlclient.so -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto -lz -Wl,--rpath -Wl,/usr/local/lamps/mysql/5.0.67/lib/mysql
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlerror'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlclose'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlopen'
../libmysql/.libs/libmysqlclient.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
make[2]: *** [mysqladmin] Fehler 1
make[2]: Leaving directory `/usr/src/lamps/mysql-5.0.67/client'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/usr/src/lamps/mysql-5.0.67'
make: *** [all] Fehler 2

What should i do before i change my mind and simply install the package for debian 4 etch?
[20 Feb 2009 17:32] Joerg Bruehe
Sorry this went unnoticed so long - it was still in status "No feedback".

Just some remarks, maybe too late for you, then at least for documentation:

1) The command which is failing is a link, "g++" will call "ld":
   g++ ... -o .libs/mysql mysql.o readline.o ...

2) The error messages mean that some function which is referenced in one (or more) object module(s) are not found in the other modules and libraries:
   ../libmysql/.libs/libmysqlclient.so: undefined reference to `dlopen'
   (and more)

3) "dlopen()" and the other missing symbols are provided in "libdl.so", so either this library name or the shorter "-ldl" are needed to make this link succeed.

4) I checked our build logs on three different Linux hosts, one of them a Debian one, and *none* of them uses "libdl" in a link of "mysqladmin" (and, frankly, I don't see why "mysqladmin" should ever need this library).

5) I suspect that the real problem is the lack of these two options to "configure":
   --with-client-ldflags="-static" --with-mysqld-ldflags="-static"

So to anybody running into such problems I propose:

1) Check that you have "libdl" installed, as the MySQL server "mysqld" will need it (but not "mysqladmin").

2) Check that your "configure" log contains lines like these:
    331 checking for dlopen in -ldl... yes
    332 checking for dlopen... yes
    333 checking for dlerror... yes
They indicate that "libdl" is found and contains these functions.
(Line numbers are taken from a 5.0.67 log, but may differ for you.)

3) Try the following options to "configure":
   --with-client-ldflags="-static" --with-mysqld-ldflags="-static"

I cannot explain why they should be needed for you, IMO the defaults should be sufficient - as they are on my local Debian machine, these are my versions:
  joerg@trift-ppc:~$ cat /etc/debian_version
  5.0
  joerg@trift-ppc:~$ gcc --version
  gcc (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-24)
  Copyright (C) ...
  joerg@trift-ppc:~$ g++ --version
  g++ (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-24)
  Copyright (C) ...

Sorry, I don't have a Debian 4.0 machine available to compare, my local machine is at 5.0 (works without these flags) and the only other we use for builds is still at 3.1 (has these flags).
[12 May 2009 13:07] MySQL Verification Team
Setting to need feedback for reporters try the prior comment suggestions.
[12 Jun 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[26 Apr 2018 14:01] Yngve Svendsen
Posted by developer:
 
Obsolete MySQL and OS versions.