tar zxvf super-smack-1.3.tar.gz
cd super-smack-1.3
对于64位系统需要修改下源码:
第193行:
< int len = 0, num_recs = 0;
修改成:
> long len = 0; int num_recs = 0;
第199,200行
< int str_len = (*i).first.length();
< if((unsigned)p + str_len + 3 *sizeof(int) < (unsigned)p_end )
修改成:
> long str_len = (*i).first.length();
> if((long)p + str_len + 3 *sizeof(int) < (long)p_end )
第219行
< len = (unsigned)p - (unsigned)buf;
修改成:
> len = (long)p - (long)buf;
./configure \
--prefix=/usr/local/super-smack \
--with-mysql \
--with-mysql-lib=/usr/local/mysql/lib/mysql/ \
--with-mysql-include=/usr/local/mysql/include/mysql/
make
cannot find -lmysqlclient
如果上面的错误报错,可能是因为先去/usr/lib/mysql(虽然configure 设置了--with-mysql-lib=/usr/local/mysql/lib/mysql/)下找相关包。可以
将/usr/local/mysql/lib/mysql/下面相关包拷贝份到/usr/lib/mysql下,或者将/usr/lib/mysql删除。
make install
/usr/local/super-smack/bin/super-smack --help
./super-smack: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
如果报上面的错误,需要设置下环境变量,如下:
export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql/