Hi,
I try to compile the mod_auth_mysql module on my Suse Linux Enterprise 9 with Apache 2.0.52 and MySQL 4.0 and I have always the same erros:
if I choose the following installation path:
/mod_auth_mysql-2.8.1 # /usr/local/apache2/bin/apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c
I get the following error:
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:243:19: mysql.h: No such file or directory
mod_auth_mysql.c:305: error: parse error before '*' token
mod_auth_mysql.c:305: warning: data definition has no type or storage class
mod_auth_mysql.c: In function `open_db_handle':
mod_auth_mysql.c:358: error: syntax error before "mysql_conn"
mod_auth_mysql.c:363: error: `mysql_conn' undeclared (first use in this function)
mod_auth_mysql.c:363: error: (Each undeclared identifier is reported only once
mod_auth_mysql.c:363: error: for each function it appears in.)
mod_auth_mysql.c:363: warning: assignment makes pointer from integer without a cast
mod_auth_mysql.c:377: warning: assignment makes pointer from integer without a cast
mod_auth_mysql.c: In function `create_mysql_auth_dir_config':
mod_auth_mysql.c:421: error: `MYSQL_PORT' undeclared (first use in this function)
mod_auth_mysql.c:425: error: `MYSQL_UNIX_ADDR' undeclared (first use in this function)
mod_auth_mysql.c: In function `get_mysql_pw':
mod_auth_mysql.c:689: error: `MYSQL_RES' undeclared (first use in this function)
mod_auth_mysql.c:689: error: `result' undeclared (first use in this function)
mod_auth_mysql.c:746: error: `MYSQL_ROW' undeclared (first use in this function)
mod_auth_mysql.c:746: error: parse error before "data"
mod_auth_mysql.c:747: error: `data' undeclared (first use in this function)
mod_auth_mysql.c: In function `get_mysql_groups':
mod_auth_mysql.c:778: error: `MYSQL_RES' undeclared (first use in this function)
mod_auth_mysql.c:778: error: `result' undeclared (first use in this function)
mod_auth_mysql.c:816: error: `MYSQL_ROW' undeclared (first use in this function)
mod_auth_mysql.c:816: error: parse error before "data"
mod_auth_mysql.c:817: error: `data' undeclared (first use in this function)
apxs:Error: Command failed with rc=65536
If I choose these commands:
/usr/local/apache2/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
I get the following error:
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
/usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_auth_mysql.la -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lm -lz -rpath /usr/local/apache2/modules -module -avoid-version mod_auth_mysql.lo
/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
What is the problem?
Grretings,
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your help, now everthing is working perfectly, the problem was that the name of the libary in my SUSE Distribution has the name zlib instead of libz, so I didnt find the correct lib name
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you please pass along what you had to change to make this work with SUSE? I'd like to update the BUILD file with the appropriate infomrmation for others.
Thanks,
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know it is late but I hope not to late. At first I had only to install the libz development package wich is named zlib at Suse and then it worked.
But now I had to chnage the database from MySQL 4.0 to MySQL 4.1 and now I have the same problem again but now I know that I have the libz or zlib development package. Is it possible that there are compilation problems with MySQL 4.1?
Greetings
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are no known problems compiling mod_auth_mysql with MySQL 4.1; I'm using it here on Debian Linux. However, SUSE is different in many respects, as you have found. And, unfortunately, I don't have access to an SUSE machine at this time.
Are you still getting a messsage about not being able to find -lz? If not, what is the message you're getting?
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the comilation works witrhout any mistakes. Si now I am glad.
But I would suggest you that you make a list with all libaries this program needs to work. Then it would be easier to check if all libaries are installed on the seystem. I do not know if it is possible to make it but perhaps it would be better that the program shows in a case of an error which libary is missing.
For Suse Linux you need to give the whole path to the mysql libaries and clients meanwhile you installed it via RPM, but I think ist is only necessary on MySQL 4.1 because with the 4.0 version i had not to give the path to the MySQL headerfiles etc.
Greetings,
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you look at the BUILD file, it does indicate you need to include the paths to the MySQL header files with the -I (upper case 'i') option and libraries with the -L option. Additionally, you need to specify the use of the MySQL client library using the -l (lower case 'L') option.
The other libraries are required by MySQL, not by us. We don't document which libraries are required because MySQL can change those at any time.
Also, header file and library paths are required if you do not have them set up as defaults in your system. As not many people have set up defaults for the MySQL libraries in their systems, which is why we document the need for those option.
I'm glad to hear you got it working.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I try to compile the mod_auth_mysql module on my Suse Linux Enterprise 9 with Apache 2.0.52 and MySQL 4.0 and I have always the same erros:
if I choose the following installation path:
/mod_auth_mysql-2.8.1 # /usr/local/apache2/bin/apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c
I get the following error:
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:243:19: mysql.h: No such file or directory
mod_auth_mysql.c:305: error: parse error before '*' token
mod_auth_mysql.c:305: warning: data definition has no type or storage class
mod_auth_mysql.c: In function `open_db_handle':
mod_auth_mysql.c:358: error: syntax error before "mysql_conn"
mod_auth_mysql.c:363: error: `mysql_conn' undeclared (first use in this function)
mod_auth_mysql.c:363: error: (Each undeclared identifier is reported only once
mod_auth_mysql.c:363: error: for each function it appears in.)
mod_auth_mysql.c:363: warning: assignment makes pointer from integer without a cast
mod_auth_mysql.c:377: warning: assignment makes pointer from integer without a cast
mod_auth_mysql.c: In function `create_mysql_auth_dir_config':
mod_auth_mysql.c:421: error: `MYSQL_PORT' undeclared (first use in this function)
mod_auth_mysql.c:425: error: `MYSQL_UNIX_ADDR' undeclared (first use in this function)
mod_auth_mysql.c: In function `get_mysql_pw':
mod_auth_mysql.c:689: error: `MYSQL_RES' undeclared (first use in this function)
mod_auth_mysql.c:689: error: `result' undeclared (first use in this function)
mod_auth_mysql.c:746: error: `MYSQL_ROW' undeclared (first use in this function)
mod_auth_mysql.c:746: error: parse error before "data"
mod_auth_mysql.c:747: error: `data' undeclared (first use in this function)
mod_auth_mysql.c: In function `get_mysql_groups':
mod_auth_mysql.c:778: error: `MYSQL_RES' undeclared (first use in this function)
mod_auth_mysql.c:778: error: `result' undeclared (first use in this function)
mod_auth_mysql.c:816: error: `MYSQL_ROW' undeclared (first use in this function)
mod_auth_mysql.c:816: error: parse error before "data"
mod_auth_mysql.c:817: error: `data' undeclared (first use in this function)
apxs:Error: Command failed with rc=65536
If I choose these commands:
/usr/local/apache2/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
I get the following error:
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
/usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_auth_mysql.la -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lm -lz -rpath /usr/local/apache2/modules -module -avoid-version mod_auth_mysql.lo
/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
What is the problem?
Grretings,
Florian
Florian,
MySQL requires the libz development package to compile programs using it. Please see the MySQL developer's documentation for more information.
Jerry
Thank you for your help, now everthing is working perfectly, the problem was that the name of the libary in my SUSE Distribution has the name zlib instead of libz, so I didnt find the correct lib name
Florian
Florian,
Glad you got it working.
Could you please pass along what you had to change to make this work with SUSE? I'd like to update the BUILD file with the appropriate infomrmation for others.
Thanks,
Jerry
I know it is late but I hope not to late. At first I had only to install the libz development package wich is named zlib at Suse and then it worked.
But now I had to chnage the database from MySQL 4.0 to MySQL 4.1 and now I have the same problem again but now I know that I have the libz or zlib development package. Is it possible that there are compilation problems with MySQL 4.1?
Greetings
Florian
Hello, Florian,
There are no known problems compiling mod_auth_mysql with MySQL 4.1; I'm using it here on Debian Linux. However, SUSE is different in many respects, as you have found. And, unfortunately, I don't have access to an SUSE machine at this time.
Are you still getting a messsage about not being able to find -lz? If not, what is the message you're getting?
Jerry
I am still getting the same error message like in the first mail
Greetings Florian
At the moment it seems as I had found a conclusion. If I use the follwoing compilation order:
/usr/local/apache/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
the comilation works witrhout any mistakes. Si now I am glad.
But I would suggest you that you make a list with all libaries this program needs to work. Then it would be easier to check if all libaries are installed on the seystem. I do not know if it is possible to make it but perhaps it would be better that the program shows in a case of an error which libary is missing.
For Suse Linux you need to give the whole path to the mysql libaries and clients meanwhile you installed it via RPM, but I think ist is only necessary on MySQL 4.1 because with the 4.0 version i had not to give the path to the MySQL headerfiles etc.
Greetings,
Florian
Florian,
If you look at the BUILD file, it does indicate you need to include the paths to the MySQL header files with the -I (upper case 'i') option and libraries with the -L option. Additionally, you need to specify the use of the MySQL client library using the -l (lower case 'L') option.
The other libraries are required by MySQL, not by us. We don't document which libraries are required because MySQL can change those at any time.
Also, header file and library paths are required if you do not have them set up as defaults in your system. As not many people have set up defaults for the MySQL libraries in their systems, which is why we document the need for those option.
I'm glad to hear you got it working.
Jerry