Page 1 of 1

MySQL error when building ZM

Posted: Sat Jan 28, 2006 7:13 pm
by GilesM
Hi,

Apologies for what is probably a stoopid question, but I cannot get ZM to build...

I am using ZM 1.21.4 and mySQL 4.0.14 on a RedHat 8.0 box. However, every time I try to run the configure script, it falls over claiming tht it can't find libmysqlclient.a The file *is* there, in the libs directory. GCC is installed and running OK.

Help?

Posted: Sun Jan 29, 2006 1:12 am
by cordel
What path did you use in your configure for zm?
The mysql path that zm is expecting is only the prefix path of mysql and not the path to it's libs or binaries.
The default prefix for packages built by RH is /usr

Regards,
Corey

Posted: Sun Jan 29, 2006 11:43 am
by GilesM
I used ./configure --with-mysql=/usr/local , since MySQL is installed at /usr/local/mysql. Was this wrong?

Giles.

Posted: Mon Jan 30, 2006 11:20 am
by zoneminder
Sometimes you can get more information from the config.log file, if you can post the last few lines from that. Also if you can paste in the exact error message you get from configure so we are all definately on the same page.

Posted: Mon Jan 30, 2006 7:15 pm
by GilesM
I've tried this again - this is the output from configure:

[root@starlight zm-1.21.4]# ./configure --with-mysql=/usr/local --with-webdir=/var/www/zm --with-cgidir=/var/www/zm/cgi-bin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: WARNING: You can call configure with the --with-ffmpeg option.
This tells configure where to find the ffmpeg root directory within which are the libavcodec
and libavformat files that can be used to build true MPEG streaming into ZoneMinder. Ensure that
your copy of ffmpeg has installed libraries as well as binaries (use 'make installlib'). If you
are using a local install of ffmpeg you may have to remove or rename a previous real installation
as the headers and libraries from that will probably be picked up before your local copy.
e.g. --with-ffmpeg=/usr/local
configure: WARNING: You can call configure with the --with-lame option.
This tells configure where to find the Lame library which can be used by the ffmpeg libraries
to generate IE compatible MPEG audio streams. This option is only necessary
if you have built
the ffmpeg package itself with the --enable-mp3lame option and if the normal link cannot
find the library. Using mp3lame is not necessary or of any benefit to ZoneMinder per se.
e.g. --with-lame=/use/local/lib
configure: WARNING: You can call configure with the --with-webuser option.
This tells configure what the user name of the web user is if it is not the
default of 'apache'.
e.g. --with-webuser=apache or --with-webuser=web
configure: WARNING: You can call configure with the --with-webgroup option.
This tells configure what the group name of the web group is if it is not the default of 'apache'.
e.g. --with-webgroup=apache or --with-webgroup=web
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking how to run the C++ preprocessor... g++ -E
checking pcre/pcre.h usability... yes
checking pcre/pcre.h presence... yes
checking for pcre/pcre.h... yes
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
checking whether round is declared... yes
checking whether strsignal is declared... yes
checking whether MD5 is declared... yes
checking for jpeg_start_compress in -ljpeg... yes
checking for compress in -lz... yes
checking for dlsym in -ldl... yes
checking for mysql_init in -lmysqlclient... no
configure: error: zm requires libmysqlclient.a


...and this is the relevant bit from the config.log file:

configure:4579: result: no
configure:4614: checking for pcre.h
configure:4621: result: no
configure:4634: checking whether round is declared
configure:4659: g++ -c -g -O2 conftest.cc >&5
configure:4665: $? = 0
configure:4669: test -z
|| test ! -s conftest.err
configure:4672: $? = 0
configure:4675: test -s conftest.o
configure:4678: $? = 0
configure:4689: result: yes
configure:4707: checking whether strsignal is declared
configure:4732: g++ -c -g -O2 conftest.cc >&5
configure:4738: $? = 0
configure:4742: test -z
|| test ! -s conftest.err
configure:4745: $? = 0
configure:4748: test -s conftest.o
configure:4751: $? = 0
configure:4762: result: yes
configure:4780: checking whether MD5 is declared
configure:4805: g++ -c -g -O2 conftest.cc >&5
configure:4811: $? = 0
configure:4815: test -z
|| test ! -s conftest.err
configure:4818: $? = 0
configure:4821: test -s conftest.o
configure:4824: $? = 0
configure:4835: result: yes
configure:4854: checking for jpeg_start_compress in -ljpeg
configure:4884: g++ -o conftest -g -O2 -L/usr -L/usr/lib -L/usr/local/lib/mysql conftest.cc -ljpeg >&5
configure:4890: $? = 0
configure:4894: test -z
|| test ! -s conftest.err
configure:4897: $? = 0
configure:4900: test -s conftest
configure:4903: $? = 0
configure:4916: result: yes
configure:4932: checking for compress in -lz
configure:4962: g++ -o conftest -g -O2 -L/usr -L/usr/lib -L/usr/local/lib/mysql conftest.cc -lz -ljpeg >&5
configure:4968: $? = 0
configure:4972: test -z
|| test ! -s conftest.err
configure:4975: $? = 0
configure:4978: test -s conftest
configure:4981: $? = 0
configure:4994: result: yes
configure:5010: checking for dlsym in -ldl
configure:5040: g++ -o conftest -g -O2 -L/usr -L/usr/lib -L/usr/local/lib/mysql conftest.cc -ldl -lz -ljpeg >&5
configure:5046: $? = 0
configure:5050: test -z
|| test ! -s conftest.err
configure:5053: $? = 0
configure:5056: test -s conftest
configure:5059: $? = 0
configure:5072: result: yes
configure:5088: checking for mysql_init in -lmysqlclient
configure:5118: g++ -o conftest -g -O2 -L/usr -L/usr/lib -L/usr/local/lib/mysql conftest.cc -lmysqlclient -ldl -lz -ljpeg >&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure:5124: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "zm"
| #define VERSION "1.21.4"
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_PCRE_PCRE_H 1
| #define HAVE_DECL_ROUND 1
| #define HAVE_DECL_STRSIGNAL 1
| #define HAVE_DECL_MD5 1
| #define HAVE_LIBJPEG 1
| #define HAVE_LIBZ 1
| #define HAVE_LIBDL 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char mysql_init ();
| int
| main ()
| {
| mysql_init ();
| ;
| return 0;
| }
configure:5150: result: no
configure:5160: error: zm requires libmysqlclient.a

Does this help?

Giles.

Posted: Tue Jan 31, 2006 11:12 am
by zoneminder
Can you just confirm where your libmysqlclient.a is? Doing a

Code: Select all

locate libmysqlclient.a
will usually tell you.

Posted: Tue Jan 31, 2006 5:00 pm
by GilesM
There are two copies:

/usr/lib/mysql/libmysqlclient.a
/usr/local/mysql-standard-4.0.14-pc-linux-i686/lib/libmysqlclient.a

The one in /usr/lib... is one I copied there from the MySQL directory (the second location, where the rest of MySQL is). There is also a symbolic link in place from /usr/local/mysql to /usr/local/mysql-standard-4.0.14-pc-linux-i686.

Giles.

Posted: Tue Jan 31, 2006 5:24 pm
by zoneminder
Copying libraries is a little bit hairy as there may be dependencies. However if your library is in /usr/lib then your --with-mysql parameter should just be /usr, provided your mysql.h header is in /usr/include/mysql

Posted: Tue Jan 31, 2006 8:42 pm
by GilesM
Aha! that seems to have cracked it - the MySQL header files weren't in the /usr/include directory. I copied them there, and it all seems to work now!

many, many thanks!

Giles.