Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error /usr/lib/../lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0' when trying to complie newest version of vim

Tags:

vim

I try to install the newest version of vim on Red Hat 6.6. I use the script below to run configure:

# change to folder where vim sources are
cd ~/vim

# here I compiled newest version of libuuid.
LIBDIR="/home/muellc1b/uuid/lib"


export LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH # prepend to path
export LDFLAGS="-L$LIBDIR"
#export LIBS="-llibuuid.so"

./configure \
    --prefix=/home/muellc1b/vim_installation
     #LIBS="-l$LIBDIR" \
     #LDFLAGS="-L$LIBDIR"

When trying to run the makefile, I get the following errors:

  gcc   -L/home/muellc1b/uuid/lib -L/usr/local/lib -Wl,--as-needed [...]   -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lSM -lICE -lXt -lX11 -lSM -lICE  -lm -ltinfo -lelf -lnsl  -lselinux -lacl -lattr -lgpm
/usr/lib/../lib64/libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0'
/usr/lib/../lib64/libSM.so: undefined reference to `uuid_generate@UUID_1.0'
collect2: error: ld returned 1 exit status

Can someone point me to a solution on how to correctly link my custom library?

like image 488
chriad Avatar asked Aug 09 '17 07:08

chriad


1 Answers

As I saw, you got a satisfactory answer here where the solution was to run the configure script normally, open src/auto/config.mk, and change the line X_PRE_LIBS = -lSM -lICE -lXpm to X_PRE_LIBS = -luuid -lSM -lICE -lXpm. Then do make.

I had exactly the same error message, but when compiling PCL (point cloud library). The error had a different cause and different solution. I'll add it here, as this page came up when looking for solution - perhaps it will help someone.

My problem was that when doing cmake .. before make it gave warnings like this:

CMake Warning at cmake/pcl_targets.cmake:194 (add_library):
Cannot generate a safe runtime search path for target pcl_io because
files in some directories may conflict with libraries in implicit directories:

All the directories that were referenced were under anaconda3/lib. I ignored it and make gave me the same error libSM.so: undefined reference to `uuid_unparse_lower@UUID_1.0' and some more :). The solution was to remove anaconda lib folder from the path, and build again. In detail:

  1. delete build directory and create it again
  2. echo $PATH and look for anaconda lib directory
  3. Copy the PATH output from previous step and remove reference to anaconda folder
  4. execute PATH=[MODIFIED_PATH] where [MODIFIED_PATH] is the result from previous step
  5. Execute echo $PATH again to see that anaconda directory has been removed
  6. build the project again in the same terminal window

Now the process uses system libraries, not the anaconda ones and compilation succeeds.

An example of modified PATH: if the original was /home/you/anaconda3/bin:/usr/local/bin:/usr/sbin:/usr/bin then the modified one is /usr/local/bin:/usr/sbin:/usr/bin

NB! You probably do not want to change the PATH permanently (your anaconda installation might stop working) that is why it is done from the terminal not from .bashrc file.

like image 59
MF.OX Avatar answered Nov 16 '22 19:11

MF.OX