Closed risaruno closed 4 months ago
- My c files compiled perfectly fine. But, when I run the file, the error told me that I need
libhiredis_cluster.so.0.13
under/usr/local/lib
folder. Which the installation didn't generate.
Did you install the built hiredis-cluster libraries using make install
? (as root/with sudo).
During this step the build will printout where the libraries are placed, is it using the expected destination?
Example:
> sudo make install
..
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libhiredis_cluster.so.0.13
...
See this example how to change the install directory.
- I compile my program again and now this what is coming.
symbol lookup error: /usr/local/lib/libhiredis_cluster.so.0.13: undefined symbol: hiredisAllocFns
When building using the provided Makefile (i.e. not using CMake) the dependency hiredis
is taken from the system and you probably have a hiredis version before 1.0, which lacks hiredisAllocFns
. hiredis-cluster require hiredis >= 1.0.
You need to upgrade your hiredis
, or you can build and install hiredis
yourself and maybe this example can give some help?
Thanks for your answer. But, I still have some questions in minds.
Did you install the built hiredis-cluster libraries using make install? (as root/with sudo). During this step the build will printout where the libraries are placed, is it using the expected destination?
Yes, I did this step in number 4.
But I'm also wondering. Why do I still need to install it using make install
even after I did the installation using build
folder?
What is the difference?
When building using the provided Makefile (i.e. not using CMake) the dependency hiredis is taken from the system and you probably have a hiredis version before 1.0, which lacks hiredisAllocFns. hiredis-cluster require hiredis >= 1.0.
Yes, I did install hiredis with a lower version in the default directory before. But, If I install the hiredis_cluster using the build folder, Isn't will overwrite the previous version?
Pardon me, if my question is too basic.
Yes, I did this step in number 4. But I'm also wondering. Why do I still need to install it using
make install
even after I did the installation usingbuild
folder? What is the difference?
There are two ways to build hiredis-cluster, either with CMake which generates a Makefile, or with a provided Makefile directly (see Readme). You only need to either build and install from the created CMake build directory, or from the repo root using the provided Makefile.
The CMake build should download the required dependency hiredis
, while the provided Makefile will use the system installed hiredis
installation.
Yes, I did install hiredis with a lower version in the default directory before. But, If I install the hiredis_cluster using the build folder, Isn't will overwrite the previous version?
It should overwrite existing libraries if the install-path is the same, but it might not be the case here.
I think I made a mistake while compiling my program.
I should've also insert the -lhiredis
and not only the -lhiredis-cluster
library.
Thank you for your explanation. ^~
I couldn't find anybody having this problem. I'm also new in C programming.
So I will just explain what I did.
build
directory and installing it usingcmake
.libhiredis_cluster.so.0.13
under/usr/local/lib
folder. Which the installation didn't generate.make
command andmake install
command to install the file that I mentioned.Is there anybody know what is happening here?
Thank you.