Once upon a time I’ve dist-upgraded Debian GNU/Linux “Etch” with some extra repositories, found that asterisk failed to start because of MySQL connection:
asterisk: relocation error: /usr/lib/odbc/libmyodbc.so: \
symbol mysql_odbc_escape_string, version libmysqlclient_15 \
not defined in file libmysqlclient_r.so.15 with link time reference
I was using ODBC to authenticate After googling I figured out that it seems like nobody’s going to fix this problem. So I’ve decided to install asterisk-addons to switch to res_mysql…
Of course the most straight decision was to upgrade MySQL client to make my res_odbc work again. And, in fact, I’ve tried this way, but as it involved upgrading of too many things, and as it was too risky to make such changes on that server I’ve decided just to install asterisk-addons. Also, on that server asterisk was using MySQL only for SIP users’ authentication and had only one macro with query to the database. So fixing of dialplan was not a big deal.
So I’ve downloaded latest asterisk-addons, unpacked them, ran ./configure and tried to compile, but something went wrong:
$ make menuselect/menuselect --check-deps menuselect.makeopts Generating embedded module rules ... make[1]: Nothing to be done for `all'. [CC] app_addon_sql_mysql.c -> app_addon_sql_mysql.o app_addon_sql_mysql.c:19:22: error: asterisk.h: No such file or directory ... make[1]: *** [app_addon_sql_mysql.o] Error 1 make: *** [apps] Error 2
After I spent some time trying to figure out what’s going on, I found chat logs where I found the solution. In fact I’ve found not only solution, but an idea where to got everything needed to fix my problem :)) So now I’ll never forget to look at ./configure --help before I’ll start googling. And solution for me was very easy :)) asterisk-addons simply wanted to know where I have installed asterisk. And as I’ve installed asterisk with --prefix=/home/asterisk all I had to do is to specify --with-asterisk=/home/asterisk:
$ ./configure --prefix=/home/asterisk \
--with-asterisk=/home/asterisk