Re: Re : Building with mysql support

Mario Splivalo <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Stipe Tolj wrote:
>> This is the excerpt from the configure.log concerning the above error,
>> as you asked:
>>
>> configure:11546: found /home/mario/Test/mysql-5.1.32/bin/mysql_config
>> configure:11559: result: /home/mario/Test/mysql-5.1.32/bin/mysql_config
>> configure:11636: checking mysql version
>> configure:11639: result: 5.1.32
>> configure:11644: checking mysql reentrant libs
>> configure:11646: result: -rdynamic
>> -L/home/mario/Test/mysql-5.1.32/lib/mysql -lmysqlclient_r -lz -lpthread
>> -lcrypt -lnsl -lm -lpthread
>> configure:11648: checking for mysql_init in -lmysqlclient_r
>> configure:11683: gcc -std=gnu99 -o conftest -g -O2 -D_XOPEN_SOURCE=600
>> -D_BSD_SOURCE -D_LARGE_FILES= -I/usr/include/libxml2
>> -I/usr/include/openssl  -rdynamic conftest.c -lmysqlclient_r  -rdynamic
>> -L/home/mario/Test/mysql-5.1.32/lib/mysql -lmysqlclient_r -lz -lpthread
>> -lcrypt -lnsl -lm -lpthread  -lssl -lrt -lresolv -lnsl -lm  -lpthread
>> -lxml2 -L/usr/lib64 -lcrypto -lssl >&5
>> configure:11690: $? = 0
>> configure:11711: result: yes
>> configure:11800: checking mysql includes
>> configure:11808: result: -I/home/mario/Test/mysql-5.1.32/include/mysql
>> configure:11828: checking mysql/mysql.h usability
>> configure:11845: gcc -std=gnu99 -c -g -O2 -D_XOPEN_SOURCE=600
>> -D_BSD_SOURCE -D_LARGE_FILES= -I/usr/include/libxml2
>> -I/usr/include/openssl -I/home/mario/Test/mysql-5.1.32/include/mysql
>> conftest.c >&5
>> conftest.c:112:25: error: mysql/mysql.h: No such file or directory
> 
> ok, so obviously we have the following path as include base:
> 
>   /home/mario/Test/mysql-5.1.32/include/mysql
> 
> but there is no file:
> 
> /home/mario/Test/mysql-5.1.32/include/mysql/mysq/mysql.h
> 
> right?
> 
> I would suggest to re-build that mysql with --prefix=/opt/mysql-5.1.32 configure
> switch, to ensure it's really all underneath in a clean installation layout.

I can't write to /opt so I rebuilt it to /tmp/install. Still no luck,
I'm getting the same error.

Now, I created dummy mysqtest.c file, like this:
#include <mysql/mysql.h>
int main () { return(0); };

Now, when I try to compile the file, I get an error, of course:
mario@mike /tmp/te$ gcc mysqltest.c
mysqltest.c:1:25: error: mysql/mysql.h: No such file or directory

Then I ask mysql_config with --include:
mario@mike /tmp/te$ /tmp/install/bin/mysql_config --include
-I/tmp/install/include/mysql

Now /tmp/install/include/mysql IS the directory where mysql.h is located!

But, if I try to compile:
mario@mike /tmp/te$ gcc mysqltest.c -I/tmp/install/include/mysql
mysqltest.c:1:25: error: mysql/mysql.h: No such file or directory

So, I need to remove trailing /mysql from the includes path, and then it
works ok, like this:
mario@mike /tmp/te$ gcc mysqltest.c -I/tmp/install/include
mario@mike /tmp/te$ ls a.out
a.out

Since i'm trying this on my laptop I can install -dev package from my
distribution (Ubuntu 9.04). Then, no matter what I put after -I when
running gcc compilation works fine.

Am I doing something wrong here, or I have distribution-related issues
concerning ldconfig or anything?

As one can see I'm not that experienced with gnu automake/maketools
processes, but I'd certainly like to build kannel with user-installed
mysql (without installing -dev packages for my distribution - because I
might want to build kannel linked with mysql6 which is not included with
my distibution). Do I need to add some more options to configure script?

	Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.