Shadowsocks-libev: [已解决]执行make的时候失败

Created on 3 Feb 2017  ·  15Comments  ·  Source: shadowsocks/shadowsocks-libev

What version of shadowsocks-libev are you using?

3.0

What operating system are you using?

CentOS Linux 2.6.32-042stab116.1 2016 x86_64 x86_64 x86_64 GNU/Linux

What did you do?

./autogen.sh && ./configure
make
make  all-recursive
make[1]: Entering directory `/root/shadowsocks-libev'
Making all in libcork
make[2]: Entering directory `/root/shadowsocks-libev/libcork'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/shadowsocks-libev/libcork'
Making all in libipset
make[2]: Entering directory `/root/shadowsocks-libev/libipset'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/shadowsocks-libev/libipset'
Making all in src
make[2]: Entering directory `/root/shadowsocks-libev/src'
  CCLD     ss-local
ss_local-crypto.o: In function `crypto_derive_key':
/root/shadowsocks-libev/src/crypto.c:112: undefined reference to `crypto_pwhash'
ss_local-aead.o: In function `cipher_aead_decrypt':
/root/shadowsocks-libev/src/aead.c:274: undefined reference to `crypto_aead_xchacha20poly1305_ietf_decrypt'
ss_local-aead.o: In function `cipher_aead_encrypt':
/root/shadowsocks-libev/src/aead.c:227: undefined reference to `crypto_aead_xchacha20poly1305_ietf_encrypt'
collect2: error: ld returned 1 exit status
make[2]: *** [ss-local] Error 1
make[2]: Leaving directory `/root/shadowsocks-libev/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/shadowsocks-libev'
make: *** [all] Error 2

Most helpful comment

I specified
./configure --with-sodium-include=/usr/include --with-sodium-lib=/usr/lib --with-mbedtls-include=/usr/include --with-mbedtls-lib=/usr/lib
It works~

All 15 comments

libsodium 版本低。

@time-river libsodium是按照Readme安装的 应该怎么装?

我在ubuntu上编译安装libsodium时不小心/usr/ 和/usr/local/都装上了,结果make shadowsocks-libev时也报这个错误。最后删掉/usr/local/下的libsodium后,make顺利通过。。。

仅供参考。

是系统存在旧libsodium的缘故,试试apt-get purge libsodium-dev再试试编译,我的通过了

1164 try specifying libsodium path by adding --with-sodium to configure

在 ./configure --with-sodium= --with-mbedtls=,应该可以解决该问题。我是同样情况

终于是成功了,由于我是自己clone编译的sodium和mbedtls所以目录都变了,之前都指定错了

--with-sodium-include=/usr/local/include --with-sodium-lib=/usr/local/lib --with-mbedtls-include=/usr/local/include --with-mbedtls-lib=/usr/local/lib

最终这些目录都需要指定才能通过

为什么我指定了/usr/local/lib 编译的时候还是找不到
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
因为 rpm/genrpm.sh 无法添加自定义参数。

ldconfig -v |grep libsodium
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
        libsodium.so.18 -> libsodium.so.18.2.0
        libsodium.so.13 -> libsodium.so.13.3.0

https://centos.pkgs.org/7/remi-x86_64/libsodium-last-1.0.12-1.el7.remi.x86_64.rpm.html
So I download libsodium-last-1.0.12-1.el7.remi.x86_64.rpm & libsodium-last-devel-1.0.12-1.el7.remi.x86_64.rpm from http://rpms.famillecollet.com/enterprise/7/remi/x86_64/
Everything is OK.

我发现造成这个问题的并不是因为二进制链接有问题,而是/usr/local里面有旧的头文件,把/usr/local/include里面的sodium文件夹和sodium.h删掉就好了

I specified
./configure --with-sodium-include=/usr/include --with-sodium-lib=/usr/lib --with-mbedtls-include=/usr/include --with-mbedtls-lib=/usr/lib
It works~

@madeye Seems that README.md Linux need update?

我的raspberry,卸载libsodium-dev和libmbedtls-dev。ok了

Was this page helpful?
0 / 5 - 0 ratings