Command to build executable:
g++ -I../include/redis -L../lib/redis redis.cpp -o redis -lhiredis
Description:
I have libhiredis.so in ../lib/redis/. And in /usr/local/lib/hiredis13/, there are libhiredis.so and libhiredis.so.0.13, this libhiredis.so is a symbol link to libhiredis.so.0.13.Then I ldd redis, here is the result:
linux-vdso.so.1 => (0x00007ffd227f7000) libhiredis.so.0.13 => not found libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f7ebca0d000) libm.so.6 => /lib64/libm.so.6 (0x00007f7ebc70b000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f7ebc4f5000) libc.so.6 => /lib64/libc.so.6 (0x00007f7ebc132000) /lib64/ld-linux-x86-64.so.2 (0x00007f7ebcd23000) Gcc should link to libhiredis.so in ../lib/redis/, am I right?
libhiredis.soin../lib/redis/is not a symbol link.libhiredis.sotolibhiredis.so.0.13and makelibhiredis.soa symbol link oflibhiredis.so.0.13.Thant worked! :-):)libhiredis.sowhich is not a symlink, so I rename it and create a symlink to it.