undefined reference to `TMRedis::MRedisSIsmember(std::basic_string<char, std::char_traits<char>, std

1.程序在linux上编译出现 undefined reference to XXXXX(std::basic_string<char, std::char_traits, std::allocator >, std::basic_string<char, std::char_traits, std::allocator >)
undefined reference to `TMRedis::MRedisSIsmember(std::basic_string<char, std::char_traits<char>, std
2.使用ldd命令,查看用到的Redis动态库

undefined reference to `TMRedis::MRedisSIsmember(std::basic_string<char, std::char_traits<char>, std
3.使用的是/usr/local/lib目录下的libMRedis.so , 那么可能程序需要的不是此版本的库,所以查询一下当前系统中有的动态库。
undefined reference to `TMRedis::MRedisSIsmember(std::basic_string<char, std::char_traits<char>, std
4.在makefile中添加一个路径,让程序在编译时,能够链接到此动态库。

比如,将 -L/usr/local/lib/ -lMRedis 换成 -L/home/oracle/Tools/SendRedis/out -lMRedis

再次编译,问题解决。