Can't Compile SoftEther

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Can't Compile SoftEther

Post by Virgil » Thu Jan 05, 2017 8:03 pm

I'm in the very first stages of setting up SoftEther and have done it for months with no problem until recently. When I try to issue to issue the 'make' command, I get the following error:

make[1]: Entering directory '/root/vpnserver'
Preparing SoftEther VPN Server...
ranlib lib/libcharset.a
ranlib lib/libcrypto.a
ranlib lib/libedit.a
ranlib lib/libiconv.a
ranlib lib/libintelaes.a
ranlib lib/libncurses.a
ranlib lib/libssl.a
ranlib lib/libz.a
ranlib code/vpnserver.a
gcc code/vpnserver.a -O2 -fsigned-char -pthread -m64 -lm -ldl -lrt -lpthread -L./ lib/libssl.a lib/libcrypto.a lib/libiconv.a lib/libcharset.a lib/libedit.a lib/libncurses.a lib/libz.a lib/libi
ntelaes.a -o vpnserver
/usr/bin/ld: code/vpnserver.a(vpnserver.o): relocation R_X86_64_32 against symbol `StopProcess' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(Unix.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(Cedar.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(Connection.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(Hub.o): relocation R_X86_64_32 against symbol `VPN_9670DF295170' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(Interop_OpenVPN.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(IPsec_IPC.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: code/vpnserver.a(IPsec_PPP.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_termcap.o): relocation R_X86_64_32S against symbol `_nc_globals' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_ti.o): relocation R_X86_64_32S against symbol `boolnames' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_tparm.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_tputs.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(read_entry.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(setbuf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(trim_sgr0.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(unctrl.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_color.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_mvcur.o): relocation R_X86_64_32 against symbol `_nc_outch' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_tstp.o): relocation R_X86_64_32S against symbol `_nc_outch' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_vidattr.o): relocation R_X86_64_32 against symbol `_nc_outch' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(comp_error.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(db_iterator.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(home_terminfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(init_keytry.o): relocation R_X86_64_32S against symbol `_nc_tinfo_fkeys' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_baudrate.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_set_term.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(lib_slkrefr.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libncurses.a(resizeterm.o): relocation R_X86_64_32 against symbol `_nc_prescreen' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(uncompr.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(deflate.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(trees.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(zutil.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(inflate.o): relocation R_X86_64_32 against symbol `zcalloc' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(inftrees.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(inffast.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lib/libintelaes.a(intel_aes.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'i_read_and_agree_the_license_agreement' failed
make[1]: *** [i_read_and_agree_the_license_agreement] Error 1
make[1]: Leaving directory '/root/vpnserver'


How may I fix this?

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Fri Jan 06, 2017 2:12 pm

Anyone? I would appreciate it if someone could provide me with some tips.

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Fri Jan 06, 2017 9:17 pm

Which compiler are you using? which OS? Versions???

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Fri Jan 06, 2017 9:52 pm

moatazelmasry wrote:
> Which compiler are you using? which OS? Versions???
Hi @moatazelmasry, I'm using Ubuntu 16.10 and I'm trying to compile softether-vpnserver-v4.20-9608-rtm-2016.04.17-linux-x64-64bit.tar.gz. It's 64 bit.

Do you have any tips?

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Sat Jan 07, 2017 12:04 am

Yes please download the latest source from github instead and compile it
https://github.com/SoftEtherVPN/SoftEtherVPN

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Sat Jan 07, 2017 9:09 am

moatazelmasry wrote:
> Yes please download the latest source from github instead and compile it
> https://github.com/SoftEtherVPN/SoftEtherVPN

I did and I get the following error now when I try to issue the 'make' command using the latest source code from github:

root@de ~/SoftEtherVPN # make
cc -DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_LINUX -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char -m64 tmp/objs/Mayaqua/Cfg.o tmp/objs/Mayaqua/Encrypt.o tmp/objs/Mayaqua/FileIO.o tmp/objs/Mayaqua/Internat.o tmp/objs/Mayaqua/Kernel.o tmp/objs/Mayaqua/Mayaqua.o tmp/objs/Mayaqua/Memory.o tmp/objs/Mayaqua/Microsoft.o tmp/objs/Mayaqua/Network.o tmp/objs/Mayaqua/Object.o tmp/objs/Mayaqua/OS.o tmp/objs/Mayaqua/Pack.o tmp/objs/Mayaqua/Secure.o tmp/objs/Mayaqua/Str.o tmp/objs/Mayaqua/Table.o tmp/objs/Mayaqua/TcpIp.o tmp/objs/Mayaqua/Tick64.o tmp/objs/Mayaqua/Tracking.o tmp/objs/Mayaqua/Unix.o tmp/objs/Mayaqua/Win32.o tmp/objs/Cedar/Account.o tmp/objs/Cedar/Admin.o tmp/objs/Cedar/AzureClient.o tmp/objs/Cedar/AzureServer.o tmp/objs/Cedar/Bridge.o tmp/objs/Cedar/BridgeUnix.o tmp/objs/Cedar/BridgeWin32.o tmp/objs/Cedar/Cedar.o tmp/objs/Cedar/CedarPch.o tmp/objs/Cedar/Client.o tmp/objs/Cedar/CM.o tmp/objs/Cedar/Command.o tmp/objs/Cedar/Connection.o tmp/objs/Cedar/Console.o tmp/objs/Cedar/Database.o tmp/objs/Cedar/DDNS.o tmp/objs/Cedar/EM.o tmp/objs/Cedar/EtherLog.o tmp/objs/Cedar/Hub.o tmp/objs/Cedar/Interop_OpenVPN.o tmp/objs/Cedar/Interop_SSTP.o tmp/objs/Cedar/IPsec.o tmp/objs/Cedar/IPsec_EtherIP.o tmp/objs/Cedar/IPsec_IKE.o tmp/objs/Cedar/IPsec_IkePacket.o tmp/objs/Cedar/IPsec_IPC.o tmp/objs/Cedar/IPsec_L2TP.o tmp/objs/Cedar/IPsec_PPP.o tmp/objs/Cedar/IPsec_Win7.o tmp/objs/Cedar/Layer3.o tmp/objs/Cedar/Link.o tmp/objs/Cedar/Listener.o tmp/objs/Cedar/Logging.o tmp/objs/Cedar/Nat.o tmp/objs/Cedar/NativeStack.o tmp/objs/Cedar/NM.o tmp/objs/Cedar/NullLan.o tmp/objs/Cedar/Protocol.o tmp/objs/Cedar/Radius.o tmp/objs/Cedar/Remote.o tmp/objs/Cedar/Sam.o tmp/objs/Cedar/SecureInfo.o tmp/objs/Cedar/SecureNAT.o tmp/objs/Cedar/SeLowUser.o tmp/objs/Cedar/Server.o tmp/objs/Cedar/Session.o tmp/objs/Cedar/SM.o tmp/objs/Cedar/SW.o tmp/objs/Cedar/UdpAccel.o tmp/objs/Cedar/UT.o tmp/objs/Cedar/VG.o tmp/objs/Cedar/Virtual.o tmp/objs/Cedar/VLan.o tmp/objs/Cedar/VLanUnix.o tmp/objs/Cedar/VLanWin32.o tmp/objs/Cedar/WaterMark.o tmp/objs/Cedar/WebUI.o tmp/objs/Cedar/WinUi.o tmp/objs/Cedar/Wpc.o src/hamcorebuilder/hamcorebuilder.c -O2 -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o tmp/hamcorebuilder
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
Makefile:318: recipe for target 'tmp/hamcorebuilder' failed
make: *** [tmp/hamcorebuilder] Error 1

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Sat Jan 07, 2017 12:00 pm

Please run
apt-get install -y libncurses-dev"

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Sat Jan 07, 2017 7:56 pm

moatazelmasry wrote:
> Please run
> apt-get install -y libncurses-dev"

I'll bother you for the last time. Unfortunately, I still get the exact same errors when I simply issue the command 'make' when I cd into the 'vpnserver' folder. I've taken a screenshot of the error and you can access it through the following link:

https://www.dropbox.com/s/6vwlbhp101unl ... 7.png?dl=0

Again, I've never experienced this before and I've set SoftEther up in countless servers. Your help would be most welcome!

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Sat Jan 07, 2017 8:24 pm

You are not bothering me :)

Sorry to ask, but are you sure you installed "libncurses-dev" ??

If you are sure, then try the command:
$ ld -lncurses --verbose

My output:
attempt to open //usr/local/lib/x86_64-linux-gnu/libncurses.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libncurses.a failed
attempt to open //lib/x86_64-linux-gnu/libncurses.so failed
attempt to open //lib/x86_64-linux-gnu/libncurses.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libncurses.so succeeded
opened script file //usr/lib/x86_64-linux-gnu/libncurses.so
opened script file //usr/lib/x86_64-linux-gnu/libncurses.so
attempt to open libncurses.so.5 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libncurses.so.5 failed
attempt to open //lib/x86_64-linux-gnu/libncurses.so.5 succeeded
libncurses.so.5 (//lib/x86_64-linux-gnu/libncurses.so.5)
attempt to open //usr/local/lib/x86_64-linux-gnu/libtinfo.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libtinfo.a failed
attempt to open //lib/x86_64-linux-gnu/libtinfo.so failed
attempt to open //lib/x86_64-linux-gnu/libtinfo.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libtinfo.so succeeded
-ltinfo (//usr/lib/x86_64-linux-gnu/libtinfo.so)
libdl.so.2 needed by //lib/x86_64-linux-gnu/libncurses.so.5
found libdl.so.2 at //lib/x86_64-linux-gnu/libdl.so.2
libc.so.6 needed by //lib/x86_64-linux-gnu/libncurses.so.5
found libc.so.6 at //lib/x86_64-linux-gnu/libc.so.6
ld-linux-x86-64.so.2 needed by //lib/x86_64-linux-gnu/libdl.so.2
found ld-linux-x86-64.so.2 at //lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address

Some paths will succeed and some paths will fail. This command also tells you where ld is looking for the library.

Now search for the library on your system:
$ find / -name libncurses.so

Assume you found it under /bla/libncurses.so
Then create s symlink to that lib under a default path which is being used by ld:
$ ln -sf /bla/libncurses.so /lib/x86_64-linux-gnu/libncurses.so.5

Also try reconfiguring the installed package:
dpkg-reconfigure ncurses-dev

To be honest, if ld search is not able to find ncurses by its own, something is really messed up on your machine

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Sat Jan 07, 2017 9:22 pm

moatazelmasry wrote:
> You are not bothering me :)
>
> Sorry to ask, but are you sure you installed "libncurses-dev" ??
>
> If you are sure, then try the command:

Thanks for the prompt reply! I'm certain that it's installed. I ensured that it was by following the steps you indicated.

1. $ld -lncurses --verbose

The following pops up when I issue that command: https://www.dropbox.com/s/aa3oai566cf70 ... 5.png?dl=0

2. To be honest, if ld search is not able to find ncurses by its own, something is really messed up on your machine

ncurses has been found and is installed in the system, any other tips mate? I'm pulling my hair at the moment

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Sat Jan 07, 2017 10:00 pm

To mimic the case, I fired up a new server on digitalocean, with ubuntu 16.10 64 bits
Ran the following commands as root:
$ apt-get update && apt-get upgrade -y
$ apt-get install -y gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev
$ mkdir -p /opt && cd /opt
$ git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
$ cd /opt/SoftEtherVPN
$ ./configure
$ make

and it compiled successfully! So I can not reproduce your problem. Any tips how to do that?


I googled a bit, and it looks like the error similar to "relocation R_X86_64_32 against symbol `StopProcess' can not be used when making a shared object; recompile with -fPIC" means that you can not use a static library to be linked against the dynamic libarary you are trying to build (weird).

The easiest solution is to try from scratsh if you are using some cloud machine.
If not, then we need to clean up a bit before trying further.
Delete and re-clone SoftEther. Then run
$ ./configure --enable-shared
$ make -fPIC

I have no idea whether this will work, since I can not reproduce the error, but try that anyway

Virgil
Posts: 7
Joined: Thu Jan 05, 2017 7:57 pm

Re: Can't Compile SoftEther

Post by Virgil » Sat Jan 07, 2017 11:59 pm

The issues were starting to pile up as I tried getting SoftEther to function with Ubuntu 16.10. I decided to downgrade to wipe my server clean and downgrade to Ubuntu 16.04. I had no issues at all whatsoever. Also, if anyone's reading this and using Hetzner's VPS, keep in mind that you'll be using a NAT configuration (something that wasn't evident to me until I logged in and checked with Hetzner since I could connect to the VPN but not access the Internet).

Thanks for being patient and trying to ensure that I would get this up and running, much appreciated moatazelmasry!

moatazelmasry
Posts: 338
Joined: Sat Aug 15, 2015 7:41 pm

Re: Can't Compile SoftEther

Post by moatazelmasry » Sun Jan 08, 2017 12:27 am

Cool. Glad it worked out

Mada
Posts: 98
Joined: Sat Jun 20, 2015 9:40 am

Re: Can't Compile SoftEther

Post by Mada » Tue Jan 10, 2017 8:53 am

I´m hitting this problem too when downloading the source from www.softether.com.

Getting it with git clone works. Is it not the same?

There is a ppa for Ubuntu with daily automatically built binary's. Maybe you should advertise that on the home page?

liuxinjianshang
Posts: 5
Joined: Mon Mar 06, 2017 5:06 am

Re: Can't Compile SoftEther

Post by liuxinjianshang » Wed Mar 08, 2017 12:40 pm

moatazelmasry wrote:
> Please run
> apt-get install -y libncurses-dev"
Thank you
Very good answer
me build Success

yanggis
Posts: 6
Joined: Tue Sep 30, 2014 5:13 am

Re: Can't Compile SoftEther

Post by yanggis » Fri Jun 02, 2017 7:54 am

I'm on the same boat. SoftEther cannot compile on Ubuntu server 17.04 with the exactly same error.

joedreamer
Posts: 1
Joined: Mon Jun 12, 2017 2:50 am

Re: Can't Compile SoftEther

Post by joedreamer » Mon Jun 12, 2017 2:57 am

I second that this problem occurred to me with Ubuntu server 17.04.
With 16.04 LTS, I have had any such problems.

cBart
Posts: 1
Joined: Mon Jun 26, 2017 10:05 am

Re: Can't Compile SoftEther

Post by cBart » Mon Jun 26, 2017 10:07 am

I had the same Problem on 17.10
sudo apt-get install lib32ncurses5-dev solved the problem on x64

(cloned from github, dont know if it helps with the packaged one)

Cheers

Post Reply