Installing Kannel SMS gateway1.5.0 on Ubuntu 20.04.1

1.2k Views Asked by At

I was able to compiled the gateway but I got the error below running the make command.

    gcc -D_REENTRANT=1 -I. -Igw -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/mysql -o gwlib/dbpool.o -c gwlib/dbpool.c
    In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from gwlib/gwlib.h:70,
                 from gwlib/dbpool.c:70:
    /usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

    In file included from gwlib/gwlib.h:83,
                 from gwlib/dbpool.c:70:
    gwlib/dbpool_mysql.c: In function ‘mysql_select’:
gwlib/dbpool_mysql.c:224:48: error: ‘my_bool’ undeclared (first use in this function); did you mean ‘xr_bool’?
  224 | bind[i].is_null = gw_malloc(sizeof(my_bool));

    gwlib/gwmem.h:122:43: note: in definition of macro ‘gw_malloc’
  122 | #define gw_malloc(size) (gw_native_malloc(size))|                                           
gwlib/dbpool_mysql.c:224:48: note: each undeclared identifier is reported only once for each function it appears in
  224 | bind[i].is_null = gw_malloc(sizeof(my_bool));

    gwlib/gwmem.h:122:43: note: in definition of macro ‘gw_malloc’
  122 | #define gw_malloc(size) (gw_native_malloc(size))

    make: *** [Makefile:230: gwlib/dbpool.o] Error 1`
1

There are 1 best solutions below

0
vishalknishad On

This error comes when you're compiling with mysql 8

To fix this, add these lines to gwlib/dbpool_mysql.c

/* define my_bool for newer versions because they use the bool or int C type instead */
#if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_BASE_VERSION)
typedef bool my_bool;
#endif