Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译muon时,make遇错 #24

Open
luckypoem opened this issue Jun 24, 2019 · 3 comments
Open

编译muon时,make遇错 #24

luckypoem opened this issue Jun 24, 2019 · 3 comments

Comments

@luckypoem
Copy link

hi。
git clone https://github.com/puxxustc/muon
cd muon
autoreconf -if
export CPPFLAGS="-I$(pwd)/lz4/lib -I$(pwd)/libmill -I$(pwd)/libsodium/src/libsodium/include"
export LDFLAGS="-L$(pwd)/lz4/lib -L$(pwd)/libmill/.libs -L$(pwd)/libsodium/src/libsodium/.libs"
./configure --prefix=/usr --sysconfdir=/etc --enable-static
make

make遇错,显示:
utils.o: In function runas': utils.c:(.text+0x7): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking //usr/local/lib/libsodium.a(libsodium_la-core.o): In function sodium_crit_enter':
/root/libsodium/src/libsodium/sodium/core.c:118: undefined reference to pthread_mutex_lock' //usr/local/lib/libsodium.a(libsodium_la-core.o): In function sodium_crit_leave':
/root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock'
/root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock' /root/libsodium/src/libsodium/sodium/core.c:136: undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x1787): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x183b): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x18de): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __deregister_frame_info_bases': (.text+0x1966): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1a36): undefined reference to pthread_mutex_lock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function _Unwind_Find_FDE': (.text+0x1a86): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_bases': (.text+0x17a6): undefined reference to pthread_mutex_unlock'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function __register_frame_info_table_bases': (.text+0x185a): undefined reference to pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make[2]: *** [muon] Error 1
make[2]: Leaving directory /root/muon/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /root/muon'
make: *** [all] Error 2
[root@host muon]#

怎么解决错误?

@puxxustc
Copy link
Owner

export LDFLAGS="-L$(pwd)/lz4/lib -L$(pwd)/libmill/.libs -L$(pwd)/libsodium/src/libsodium/.libs -lpthread"

@luckypoem
Copy link
Author

还是不行。我下载了muon-x86_64到服务器上。
root@host ~]# ./muon-x86_64 -c muon-server.conf
[19-06-25 16:41:03] starting muon server
[19-06-25 16:41:03] using tun device: tun2

在mac上,
brew install --HEAD libmill
brew install libsodium lz4
brew install --HEAD https://raw.githubusercontent.com/puxxustc/muon/master/contrib/homebrew/muon.rb
成功安装muon.
然后,
yudeMacBook-Air:~ brite$ sudo muon -c /usr/local/etc/muon/examples/client.conf
[19-06-25 17:20:16] starting muon client
[19-06-25 17:20:16] failed to init tun device
yudeMacBook-Air:~ brite$ cat /usr/local/etc/muon/examples/client.conf

muon client config

user to set privilege to

user=nobody

server or client

mode=client

server address

server=my-vps-ip

server port

port=2000

secret key for crypto

run `dd if=/dev/random bs=1 count=9 | md5sum' to create one

key=df61aad78a0a238aca27e0ba3722f304

TUN device name, tunX for linux, utunX for darwin

tunif=tun2

MTU of TUN device

Ethernet: 1500 - 20(IPv4, or 40 for IPv6) - 8(UDP) - 20(muon)

PPPoE: 1492 - 20(IPv4, or 40 for IPv6) - 8(UDP) - 20(muon)

mtu=1440

IPv4 address of TUN device, CIDR notation

address=10.10.20.2/31

IPv6 address of TUN device, CIDR notation

address6=

IPv4 address of remote peer (darwin only)

peer=10.10.20.2

add route or not

route=yes
yudeMacBook-Air:~ brite$

'failed to init tun device'问题怎么解决?mac上,已安装tuntaposx.即使把tunif的值改为utun2,也是遇到一样的错误。怎么在mac上,运行你这个程序,不是自动生成虚拟网卡的吗

@luckypoem
Copy link
Author

服务器上,倒是自动生成了虚拟网卡tun2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants