命令make
引发错误消息
/usr/bin/ld: cannot find -lidn
/usr/bin/ld: cannot find -lldap
collect2: ld returned 1 exit status
make[2]: *** [../bin/SomeApp] Error 1
make[1]: *** [CMakeFiles/SomeApp.dir/all] Error 2
make: *** [all] Error 2
然而,lgconfig -p | grep idn
回报
libidn.so.11 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libidn.so.11
libcidn.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcidn.so.1
libcidn.so.1 (libc6, OS ABI: Linux 2.6.24) => /lib/i386-linux-gnu/libcidn.so.1
libcidn.so (libc6,x86-64, OS ABI: Linux 2.6.24) => /usr/lib/x86_64-linux-gnu/libcidn.so
并ldconfig -p | grep ldap
返回
libldap_r-2.4.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2
libldap_r-2.4.so.2 (libc6) => /usr/lib/i386-linux-gnu/libldap_r-2.4.so.2
我怎样才能消除这些链接错误?
答案1
通过安装这些库的开发版本解决了这个问题
sudo apt-get install libldap2-dev
sudo apt-get install libidn11-dev