error: zlib required

Questions, advices, reports

Moderators: Main Administator, Moderator, Global Moderator

Post Reply
User avatar
YuGiOhJCJ
Xmoto Player
Xmoto Player
Posts: 2
Joined: Thu Aug 30, 2012 12:13 pm

error: zlib required

Post by YuGiOhJCJ » Fri Aug 31, 2012 12:23 pm

Hello,

I try to build xmoto-0.5.10 from source code on a Slackware 13.37 operating system.
I got two problems in the configure step.

First, I got a problem with sqlite3 in the configure step:
$ ./configure --prefix=/usr
[...]
configure: error: "Linking against sqlite3 failed."
I have sqlite-3.7.5 installed on my computer.
$ ls -l /usr/lib/libsqlite3.*
-rwxr-xr-x 1 root root 932 Apr 1 2011 /usr/lib/libsqlite3.la
lrwxrwxrwx 1 root root 19 Aug 14 12:58 /usr/lib/libsqlite3.so -> libsqlite3.so.0.8.6
lrwxrwxrwx 1 root root 19 Aug 14 12:58 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.0.8.6
-rwxr-xr-x 1 root root 507884 Apr 1 2011 /usr/lib/libsqlite3.so.0.8.6
The program tested [1] in the configure script doesn't compile on my computer:
$ gcc -lsqlite3 sqlite3.c
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libsqlite3.so: undefined reference to `dlsym'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libsqlite3.so: undefined reference to `dlerror'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libsqlite3.so: undefined reference to `dlopen'
/usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libsqlite3.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
But it compiles fine if I do this:
$ gcc -ldl -lsqlite3 sqlite3.c
So the solution is to edit the configure script and replace this line :
LIBS="-lsqlite3 $LIBS"
by this line :
LIBS="-ldl -lsqlite3 $LIBS"

After I resolved this problem with sqlite3, I got a new problem with zlib in the configure step:
$ ./configure --prefix=/usr
[...]
configure: error: zlib required
I have zlib-1.2.5 installed on my computer.
$ ls -l /usr/lib/libz.*
-rw-r--r-- 1 root root 89366 Feb 9 2011 /usr/lib/libz.a
lrwxrwxrwx 1 root root 13 Aug 14 13:05 /usr/lib/libz.so -> libz.so.1.2.5
lrwxrwxrwx 1 root root 13 Aug 14 13:05 /usr/lib/libz.so.1 -> libz.so.1.2.5
-rwxr-xr-x 1 root root 76744 Feb 9 2011 /usr/lib/libz.so.1.2.5
And the program tested [2] in the configure script compile fine on my computer:
$ gcc -lz zlib.c

Do I have a bugged version of sqlite?
What's the reason the configure script doesn't found my zlib?

Thank you.
Regards.

[1] program for sqlite3

Code: Select all

 /* confdefs.h */
 #define PACKAGE_NAME ""
 #define PACKAGE_TARNAME ""
 #define PACKAGE_VERSION ""
 #define PACKAGE_STRING ""
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
 #define PACKAGE "xmoto"
 #define VERSION "0.5.10"
 #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 __EXTENSIONS__ 1
 #define _ALL_SOURCE 1
 #define _GNU_SOURCE 1
 #define _POSIX_PTHREAD_SEMANTICS 1
 #define _TANDEM_SOURCE 1
 #define XMOTO_LITTLE_ENDIAN 1
 #define HAVE_SQLITE3_H 1
 /* end confdefs.h.  */
 
 
 int
 main ()
 {
 return main ();
   ;
   return 0;
 }
[2] program for zlib

Code: Select all

 /* confdefs.h */
 #define PACKAGE_NAME ""
 #define PACKAGE_TARNAME ""
 #define PACKAGE_VERSION ""
 #define PACKAGE_STRING ""
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
 #define PACKAGE "xmoto"
 #define VERSION "0.5.10"
 #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 __EXTENSIONS__ 1
 #define _ALL_SOURCE 1
 #define _GNU_SOURCE 1
 #define _POSIX_PTHREAD_SEMANTICS 1
 #define _TANDEM_SOURCE 1
 #define XMOTO_LITTLE_ENDIAN 1
 #define HAVE_SQLITE3_H 1
 #define HAVE_LIBSQLITE3 1
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
 char uncompress ();
 int
 main ()
 {
 return uncompress ();
   ;
   return 0;
 }

User avatar
YuGiOhJCJ
Xmoto Player
Xmoto Player
Posts: 2
Joined: Thu Aug 30, 2012 12:13 pm

Re: error: zlib required

Post by YuGiOhJCJ » Tue Sep 11, 2012 5:39 pm

I recompiled from source code zlib and sqlite3 and it solved the problem:
-sqlite-3.7.11
-zlib-1.2.7

Code: Select all

$ ./configure --prefix=/usr
$ make
$ make install DESTDIR=/tmp/xmoto-0.5.10
No need to patch the xmoto source code.

Probably we need the last version of both libraries...
Problem solved :)

Post Reply

Return to “(-OLD UNSORTED-) Technical Problems”

Who is online

Users browsing this forum: No registered users and 1 guest