Can't load res_odbc.so

Hello,
I installed mysql odbc (asterisk 1.8) :
unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
yum install mysql-connector-odbc

i compiled my asterisk ,

configured /etc/odbcinst.ini and /etc/odbc.in

when i launch :
echo “select 1” | isql -v asterisk-connector
i get :
±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+
SQL> select 1
±--------------------+
| 1 |
±--------------------+
| 1 |
±--------------------+
SQLRowCount returns 1

but when i use CLR

module load res_odbc.so
Unable to load module res_odbc.so
Command ‘module load res_odbc.so’ failed.
[Jun 18 09:41:25] WARNING[9577]: loader.c:777 inspect_module: Module ‘res_odbc.so’ was not compiled with the same compile-time options as this version of Asterisk.
[Jun 18 09:41:25] WARNING[9577]: loader.c:778 inspect_module: Module ‘res_odbc.so’ will not be initialized as it may cause instability.
[Jun 18 09:41:25] WARNING[9577]: loader.c:861 load_resource: Module ‘res_odbc.so’ could not be loaded.

Can someone help me to resole this issue?

Thanks;

Did you stop and restart Asterisk?

If you did, you probably had a dirty build directory. Remove all the object files and rebuild (I think make clean may be too drastic for the way the sources are distributed), or start over extracting the source from the tarball.

tx for your reply,
I made
make distclean
./configure
make menuselect
make install

when i try to restart my asterisk, i get this error :
ERROR: ASTERISK_SBIN_DIR/asterisk not found

In that case it failed to build and you need to look for the first error message.

It’s ok, i resolved this problem, i edited /etc/init.d/asterisk
it works fine now, apparently odbc too is loaded

cl-t222-132cl*CLI> odbc show

ODBC DSN Settings

Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last connection attempt: 2016-06-18 14:03:41

but in CRL i get this error :

[Jun 18 14:06:41] WARNING[5730]: app_voicemail.c:5204 inboxcount2: Failed to obtain database object for ‘asterisk’!

any idea??