TelegramMessenger / MTProxy

5.01k stars 830 forks source link

Build Error (ArchLinux) #409

Open FollowMeDown opened 4 years ago

FollowMeDown commented 4 years ago
cc -o objs/bin/mtproto-proxy objs/mtproto/mtproto-proxy.o objs/mtproto/mtproto-config.o objs/net/net-tcp-rpc-ext-server.o objs/lib/libkdb.a objs/lib/libkdb.a  -ggdb -rdynamic -lm -lrt -lcrypto -lz -lpthread -lcrypto
/usr/bin/ld: objs/mtproto/mtproto-config.o:(.bss+0x200a0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/net/net-tcp-rpc-ext-server.o:(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(resolver.o):(.bss+0x0): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(parse-config.o):(.bss+0x28): multiple definition of `kdb_hosts_loaded'; objs/mtproto/mtproto-proxy.o:(.bss+0x4f01b48): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-rpc-targets.o):(.bss+0x820): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-http-server.o):(.bss+0x18): multiple definition of `http_queries'; objs/mtproto/mtproto-proxy.o:(.bss+0x488): first defined here
/usr/bin/ld: objs/lib/libkdb.a(engine-rpc.o):(.bss+0x0): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(net-stats.o):(.bss+0x8): multiple definition of `total_vv_tree_nodes'; objs/lib/libkdb.a(net-connections.o):(.bss+0xc34a8): first defined here
/usr/bin/ld: objs/lib/libkdb.a(pid.o):(.bss+0x0): multiple definition of `PID'; objs/lib/libkdb.a(net-stats.o):(.bss+0x30): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:94: objs/bin/mtproto-proxy] Error 1
FollowMeDown commented 4 years ago
$ uname -a 
Linux test 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64 GNU/Linux
FollowMeDown commented 4 years ago

The Same Issue on OpenBSD 6.7

shervinkh commented 4 years ago

Related to this issue:

https://bbs.archlinux.org/viewtopic.php?id=255727 https://gcc.gnu.org/gcc-10/porting_to.html

matrix47 commented 4 years ago

I managed to fix it for me by adding "-fcommon" to CFLAGS in Makefile file.