hiredis icon indicating copy to clipboard operation
hiredis copied to clipboard

CMake sets incorrect version for library

Open kendamaskareivis opened this issue 2 years ago • 1 comments

When compiling this library, incorrect version is linked to shared object file. I pulled latest 1.2.0 tag, it's creating 1.1.0 instead of 1.2.0. https://github.com/redis/hiredis/blob/master/CMakeLists.txt#L53 https://github.com/redis/hiredis/blob/master/CMakeLists.txt#L167

Plus it would be very nice to also add in symlinking to major release so when compiling this library we would get .so .so.1 .so.1.x.x instead of currently .so .so.1.x.x

# Proper symlinks with correct Cmakefile
lrwxrwxrwx 1 root root     15 okt  6 13:33 libhiredis.so -> libhiredis.so.1
lrwxrwxrwx 1 root root     19 okt  6 13:33 libhiredis.so.1 -> libhiredis.so.1.2.0
-rwxrwxr-x 1 root root 106296 okt  6 13:33 libhiredis.so.1.2.0

# What current project Cmakefile is doing
lrwxrwxrwx 1 root root     19 okt  6 13:44 libhiredis.so -> libhiredis.so.1.1.0
-rwxrwxr-x 1 root root 106296 okt  6 13:44 libhiredis.so.1.1.0

This is caused because of improper CMake configuration and wrong hiredis.h header .so (shared object) definitions

kendamaskareivis avatar Oct 06 '23 10:10 kendamaskareivis

I get error ./hiredis-test: error while loading shared libraries: libhiredis.so.1.1.0: cannot open shared object file: No such file or directory on hiredis-1.2.0. How to fix ?

truongan07 avatar Dec 02 '23 19:12 truongan07

Fixed in 1.3.0

uglide avatar Apr 23 '25 11:04 uglide