[Asterisk-Users] Trouble compiling asterisk-addons MySQL

James Freire JFreire at Comtech21.com
Wed Jul 28 07:57:55 MST 2004


Yep.. I already have the headers and required files. Here is what I am getting now with my Make file also below it.



root at linux2:/usr/src/asterisk-addons# make install
./mkdep -fPIC -I../asterisk -I/usr/local/mysql/include/mysql 
-D_GNU_SOURCE -I/usr/local/mysql/include    `ls *.c`
cc -fPIC -I../asterisk -I/usr/local/mysql/include/mysql -D_GNU_SOURCE 
-I/usr/local/mysql/include      -c -o cdr_addon_mysql.o cdr_addon_mysql.c
cc -shared -Xlinker -x -o cdr_addon_mysql.so cdr_addon_mysql.o 
-lmysqlclient -lz   -L/usr/local/mysql/lib  
/usr/lib/gcc-lib/i486-slackware-linux/3.2.3/../../../../i486-slackware-linux/bin/ld: 
cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [cdr_addon_mysql.so] Error 1



#
# Asterisk -- A telephony toolkit for Linux.
#
# Makefile for CDR backends (dynamically loaded)
#
# Copyright (C) 1999, Mark Spencer
#
# Mark Spencer <markster at linux-support.net>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#

MODS=

CFLAGS+=-fPIC
CFLAGS+=-I../asterisk
CFLAGS+=-I/usr/local/mysql/include/mysql
CFLAGS+=-D_GNU_SOURCE

INSTALL=install
INSTALL_PREFIX=
ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
MODULES_DIR=$(ASTLIBDIR)/modules

#
# MySQL stuff...  Autoconf anyone??
#
MODS+=$(shell if [ -d /usr/local/mysql/include/mysql ] || [ -d 
/usr/include/mysql ] || [ -d /usr
/local/include/mysql ] || [ -d /opt/mysql/include ]; then echo 
"cdr_addon_mysql.so"; fi)
CFLAGS+=$(shell if [ -d /usr/local/mysql/include/mysql ]; then echo 
"-I/usr/local/mysql/include"
; fi)
CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo 
"-I/usr/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /usr/local/include/mysql ]; then echo 
"-I/usr/local/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /opt/mysql/include/mysql ]; then echo 
"-I/opt/mysql/include/mysql"; fi)
MLFLAGS=
MLFLAGS+=$(shell if [ -d /usr/lib/mysql ]; then echo "-L/usr/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/mysql/lib ]; then echo 
"-L/usr/local/mysql/lib"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/lib/mysql ]; then echo 
"-L/usr/local/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /opt/mysql/lib/mysql ]; then echo 
"-L/opt/mysql/lib/mysql"; fi)

all: depend $(MODS)

install: all
        for x in $(MODS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done

clean:
        rm -f *.so *.o .depend

%.so : %.o
        $(CC) -shared -Xlinker -x -o $@ $<

ifneq ($(wildcard .depend),)
include .depend
endif

cdr_addon_mysql.so: cdr_addon_mysql.o
        $(CC) -shared -Xlinker -x -o $@ $< -lmysqlclient -lz $(MLFLAGS)

depend: .depend

.depend:
        ./mkdep $(CFLAGS) `ls *.c`

-----Original Message-----
From: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Oleg A.
Arkhangelsky
Sent: Wednesday, July 28, 2004 9:48 AM
To: asterisk-users-admin at lists.digium.com; James Freire
Cc: asterisk-users at lists.digium.com
Subject: Re: [Asterisk-Users] Trouble compiling asterisk-addons MySQL


Hello James,

Wednesday, July 28, 2004, 5:23:16 PM, you wrote:

JF> root at linux2:/usr/src/asterisk-addons# make install
JF> ./mkdep -fPIC -I../asterisk -D_GNU_SOURCE     `ls *.c`
JF> cdr_addon_mysql.c:33:19: mysql.h: No such file or directory
JF> cdr_addon_mysql.c:34:20: errmsg.h: No such file or directory
JF> for x in  ; do install -m 755 $x /usr/lib/asterisk/modules ; done

    You need to install libmysqlclient-devel (or alike) package with
    relevant header files.

-- 
Best regards,
 Oleg                            mailto:sysoleg at progtech.ru

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list