mysql.h exists but cant be found (3.18.2)

Everything related with getting rsyslog up and running (but not beyond that point ;))

Moderator: rgerhards

mysql.h exists but cant be found (3.18.2)

Postby bmccall » Fri Aug 15, 2008 8:01 pm

The situation- I installed 3.17.2 via the BSD Port with the rsyslog3-mysql port as well. Everything was setup and writing to my DB perfectly. I installed and configured another machine to be a forwarder/relay and discovered the problem of the headers getting manipulated when relayed/forwarded. 3.17.2 is the most up do date port so I decided to manually install 3.18.2. I have attempted to get it to run for a while and continue getting the following error during ./configure

checking for zlib.h... yes
checking for deflate in -lz... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking for SYSLOG_UNIXAF support... yes
checking for FSSTND support... yes
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
configure: error: MySQL is missing
See `config.log' for more details.

mysql.h exists but it fails.. I've googled all day and haven't came across anything... even when I point configure directly to /usr/local/include it still bombs... any ideas? Im wondering if it has something to do with the rsyslog3-mysql port... but I don't know where to start as I've done a make deinstall of rsyslog3 and rsyslog3-mysql... any thoughts would be greatly appreciated.

-Barry

7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Wed Jun 18 07:33:20 UTC 2008 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

./configure --enable-mysql --with-mysql-includes=/usr/local/include --enable-klog --disable-static --enable-mail --enable-imfile --enable-imtemplate --enable-openssl --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ i386-portbld-freebsd7.0

/usr/local/include listing....
-r--r--r-- 1 root wheel 4050 Jul 14 16:54 decimal.h
-r--r--r-- 1 root wheel 3866 Jul 14 16:54 errmsg.h
-r--r--r-- 1 root wheel 6705 Jul 14 16:54 keycache.h
-r--r--r-- 1 root wheel 21374 Jul 14 16:54 m_ctype.h
-r--r--r-- 1 root wheel 8120 Jul 14 16:54 m_string.h
-r--r--r-- 1 root wheel 1810 Jul 14 16:54 my_alloc.h
-r--r--r-- 1 root wheel 1941 Jul 14 16:54 my_attribute.h
-r--r--r-- 1 root wheel 30808 Jul 14 16:54 my_config.h
-r--r--r-- 1 root wheel 3872 Jul 14 16:54 my_dbug.h
-r--r--r-- 1 root wheel 3460 Jul 14 16:54 my_dir.h
-r--r--r-- 1 root wheel 2916 Jul 14 16:54 my_getopt.h
-r--r--r-- 1 root wheel 43465 Jul 14 16:54 my_global.h
-r--r--r-- 1 root wheel 1466 Jul 14 16:54 my_list.h
-r--r--r-- 1 root wheel 3853 Jul 14 16:54 my_net.h
-r--r--r-- 1 root wheel 1669 Jul 14 16:54 my_no_pthread.h
-r--r--r-- 1 root wheel 27386 Jul 14 16:54 my_pthread.h
-r--r--r-- 1 root wheel 36770 Jul 14 16:54 my_sys.h
-r--r--r-- 1 root wheel 1958 Jul 14 16:54 my_xml.h
-r--r--r-- 1 root wheel 33861 Jul 14 16:54 mysql.h
-r--r--r-- 1 root wheel 17249 Jul 14 16:54 mysql_com.h
-r--r--r-- 1 root wheel 1175 Jul 14 16:54 mysql_embed.h
-r--r--r-- 1 root wheel 2097 Jul 14 16:54 mysql_time.h
-r--r--r-- 1 root wheel 797 Jul 14 16:54 mysql_version.h
-r--r--r-- 1 root wheel 16678 Jul 14 16:54 mysqld_ername.h
-r--r--r-- 1 root wheel 16733 Jul 14 16:54 mysqld_error.h
-r--r--r-- 1 root wheel 5796 Jul 14 16:54 raid.h
-r--r--r-- 1 root wheel 1804 Jul 14 16:54 sql_common.h
-r--r--r-- 1 root wheel 10936 Jul 14 16:54 sql_state.h
-r--r--r-- 1 root wheel 1006 Jul 14 16:54 sslopt-case.h
-r--r--r-- 1 root wheel 2163 Jul 14 16:54 sslopt-longopts.h
-r--r--r-- 1 root wheel 1107 Jul 14 16:54 sslopt-vars.h
-r--r--r-- 1 root wheel 1300 Jul 14 16:54 typelib.h
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: mysql.h exists but cant be found (3.18.2)

Postby mbiebl » Fri Aug 15, 2008 11:49 pm

Does
"CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --enable-mysql"
help (note the CPPFLAGS and LDFLAGS env variables)
mbiebl
Advanced
 
Posts: 39
Joined: Wed Dec 05, 2007 12:46 am

Re: mysql.h exists but cant be found (3.18.2)

Postby bmccall » Mon Aug 18, 2008 2:41 pm

mbiebl wrote:Does
"CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --enable-mysql"
help (note the CPPFLAGS and LDFLAGS env variables)


I gave this a shot and it didn't work. After trying every var in the config to point to the correct location I decided to edit configure and just fed it then entire path.

was:
for ac_header in mysql/mysql.h

changed to:
for ac_header in /usr/local/include/mysql/mysql.h

and of course it found it. However... make became a whole new issue (as I expected) as when ommysql.c was compiling it failed. The result follows.

gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/usr/local/include/mysql -fno-strict-aliasing -pipe -pthread -g -O2 -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -MT ommysql_la-ommysql.lo -MD -MP -MF .deps/ommysql_la-ommysql.Tpo -c ommysql.c -fPIC -DPIC -o .libs/ommysql_la-ommysql.o
ommysql.c:38:25: error: mysql/mysql.h: No such file or directory
ommysql.c:39:26: error: mysql/errmsg.h: No such file or directory
ommysql.c:56: error: expected specifier-qualifier-list before 'MYSQL'
ommysql.c: In function 'closeMySQL':
ommysql.c:85: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:86: warning: implicit declaration of function 'mysql_server_end'
ommysql.c:87: warning: implicit declaration of function 'mysql_close'
ommysql.c:87: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:88: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c: In function 'reportDBError':
ommysql.c:117: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:120: warning: implicit declaration of function 'mysql_errno'
ommysql.c:120: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:122: warning: implicit declaration of function 'mysql_error'
ommysql.c:122: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:122: warning: format '%s' expects type 'char *', but argument 5 has type 'int'
ommysql.c:122: warning: format '%s' expects type 'char *', but argument 5 has type 'int'
ommysql.c:123: error: 'instanceData' has no member named 'uLastMySQLErrno'
ommysql.c:126: error: 'instanceData' has no member named 'uLastMySQLErrno'
ommysql.c: In function 'initMySQL':
ommysql.c:146: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:146: warning: implicit declaration of function 'mysql_init'
ommysql.c:147: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:152: warning: implicit declaration of function 'mysql_real_connect'
ommysql.c:152: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:152: error: 'instanceData' has no member named 'f_dbsrv'
ommysql.c:152: error: 'instanceData' has no member named 'f_dbuid'
ommysql.c:153: error: 'instanceData' has no member named 'f_dbpwd'
ommysql.c:153: error: 'instanceData' has no member named 'f_dbname'
ommysql.c:153: warning: comparison between pointer and integer
ommysql.c: In function 'writeMySQL':
ommysql.c:176: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:181: warning: implicit declaration of function 'mysql_query'
ommysql.c:181: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:185: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c:195: error: 'instanceData' has no member named 'uLastMySQLErrno'
ommysql.c: In function 'tryResume':
ommysql.c:204: error: 'instanceData' has no member named 'f_hmysql'
ommysql.c: In function 'parseSelectorAct':
ommysql.c:244: error: 'instanceData' has no member named 'f_dbsrv'
ommysql.c:246: error: 'instanceData' has no member named 'f_dbsrv'
ommysql.c:248: error: 'instanceData' has no member named 'f_dbname'
ommysql.c:250: error: 'instanceData' has no member named 'f_dbname'
ommysql.c:252: error: 'instanceData' has no member named 'f_dbuid'
ommysql.c:254: error: 'instanceData' has no member named 'f_dbuid'
ommysql.c:256: error: 'instanceData' has no member named 'f_dbpwd'
ommysql.c:276: error: 'instanceData' has no member named 'f_hmysql'
*** Error code 1

Stop in /usr/home/bmccall/rsyslog-3.18.2/plugins/ommysql.
*** Error code 1

Stop in /usr/home/bmccall/rsyslog-3.18.2.
*** Error code 1

Stop in /usr/home/bmccall/rsyslog-3.18.2.
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Re: mysql.h exists but cant be found (3.18.2)

Postby mbiebl » Mon Aug 18, 2008 3:57 pm

Could you please post the output of
mysql_config --cflags
and
mysql_config --libs
mbiebl
Advanced
 
Posts: 39
Joined: Wed Dec 05, 2007 12:46 am

Re: mysql.h exists but cant be found (3.18.2)

Postby bmccall » Mon Aug 18, 2008 4:14 pm

mbiebl wrote:Could you please post the output of
mysql_config --cflags
and
mysql_config --libs



--cflags [-I/usr/local/include/mysql -fno-strict-aliasing -pipe]
--libs [-L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm]
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Re: mysql.h exists but cant be found (3.18.2)

Postby mbiebl » Mon Aug 18, 2008 5:15 pm

bmccall wrote:
mbiebl wrote:Does
"CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --enable-mysql"
help (note the CPPFLAGS and LDFLAGS env variables)


I gave this a shot and it didn't work. After trying every var in the config to point to the correct location I decided to edit configure and just fed it then entire path.

was:
for ac_header in mysql/mysql.h

changed to:
for ac_header in /usr/local/include/mysql/mysql.h

and of course it found it. However... make became a whole new issue (as I expected) as when ommysql.c was compiling it failed. The result follows.

gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/usr/local/include/mysql -fno-strict-aliasing -pipe -pthread -g -O2 -W -Wall -Wformat-security .


If I look at this line, the include path /usr/local/include apparently wasn't added.

Are you sure, you have used
"CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --enable-mysql"
?
If you grep the config.log for CPPFLAGS, you should get
# grep CPPFLAGS config.log
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-I/usr/local/include
CPPFLAGS='-I/usr/local/include'
mbiebl
Advanced
 
Posts: 39
Joined: Wed Dec 05, 2007 12:46 am

Re: mysql.h exists but cant be found (3.18.2)

Postby bmccall » Mon Aug 18, 2008 6:03 pm

Perhaps I fat-fingered something previously because it worked that time. Maybe now my today will go a little smoother. I was able to make and install. Running smoothly now. Was even able to copy the rsyslogd bsd script that the ports tree uses and it works/starts/restarts fine and everything :wink: Thank you all so much!! :D
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Re: mysql.h exists but cant be found (3.18.2)

Postby coroy » Mon Jan 26, 2009 9:39 am

Even though this is already solved, I'll post this command that can be use for others or even me someday. :D

Assuming that MySql is already intalled. Here's the command for compiling the new version for Rsyslog.

./configure CFLAGS="-I/usr/local/include/" LDFLAGS="-L/usr/local/lib" --enable-mysql --enable-klog --disable-static --enable-mail --enable-imfile --enable-imtemplate --enable-openssl --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ amd64-portbld-freebsd7.1 --enable-debug


Thanks
coroy
Avarage
 
Posts: 14
Joined: Tue Sep 30, 2008 12:09 pm

Google Ads



Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests

cron