RejectedSoftware Forums

Sign up

Ubuntu 18.04 linking problem

Just made the hello project dub init hello --type:vibe.d.
I do have libssl-dev installed: 1.1.0g-2ubuntu4 the default for Ubuntu 18.04 which I had to install explicitly, else linking failed saying libssl and libcrypto could not be found.
Everything builds with dmd 2.080.0, but linking fails as below. Please help.

Linking...
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl_f0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext6__ctorMFNfEQBwQBu3tls14TLSContextKindEQCxQCvQBb10TLSVersionZ9__lambda3MFNbNeZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:467: undefined reference to `SSLv23_client_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:468: undefined reference to `SSLv23_client_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:472: undefined reference to `SSLv23_client_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:473: undefined reference to `SSLv23_client_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:480: undefined reference to `SSLv23_server_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:481: undefined reference to `SSLv23_server_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:483: undefined reference to `SSLv23_server_method'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:484: undefined reference to `SSLv23_server_method'
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl_f0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext11setDHParamsMFNeAyaZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:722: undefined reference to `get_rfc3526_prime_2048'
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(safestack_5fd_449.o): In function `_D6deimos7openssl9safestack__T10SKM_sk_numTSQBqQBm6x509v315GENERAL_NAME_stZ__TQBwZQCaFNbPSQDkQDgQDb__T8STACK_OFTQCrZQoZi':
/home/carl/Documents/vibed/hello/../../../.dub/packages/openssl-1.1.6_1.0.1g/openssl/deimos/openssl/safestack.d:140: undefined reference to `sk_num'
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(safestack_5ff_516.o): In function `_D6deimos7openssl9safestack__T12SKM_sk_valueTSQBsQBo6x509v315GENERAL_NAME_stZ__TQByZQCcFNbPSQDmQDiQDd__T8STACK_OFTQCrZQoiZPQDa':
/home/carl/Documents/vibed/hello/../../../.dub/packages/openssl-1.1.6_1.0.1g/openssl/deimos/openssl/safestack.d:142: undefined reference to `sk_value'
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl.o): In function `_D4vibe6stream7openssl18_sharedStaticCtor1FZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:911: undefined reference to `SSL_load_error_strings'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:912: undefined reference to `SSL_library_init'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:914: undefined reference to `CRYPTO_num_locks'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:922: undefined reference to `CRYPTO_set_id_callback'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:923: undefined reference to `CRYPTO_set_locking_callback'
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:928: undefined reference to `SSL_get_ex_new_index'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.

Re: Ubuntu 18.04 linking problem

Am 25.05.2018 um 23:59 schrieb Carl Sturtivant:

Just made the hello project dub init hello --type:vibe.d.
I do have libssl-dev installed: 1.1.0g-2ubuntu4 the default for Ubuntu 18.04 which I had to install explicitly, else linking failed saying libssl and libcrypto could not be found.
Everything builds with dmd 2.080.0, but linking fails as below. Please help.

Linking...
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl_f0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext6__ctorMFNfEQBwQBu3tls14TLSContextKindEQCxQCvQBb10TLSVersionZ9__lambda3MFNbNeZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:467: undefined reference to `SSLv23_client_method'
(...)

Ubuntu 18.04 has switched to OpenSSL 1.1.x, which means that the
corresponding "openssl-1.1" configuration of vibe-d:tls now needs to be
selected. There are two possible ways, using the command line or using
the package recipe.

The command line way is "dub --override-config=vibe-d:tls/openssl-1.1",
using the package recipe is described in the HTTPS section of the
docs
. For public packages I'd recommend to stick with the command
line switch, so that the end user keeps the full flexibility, whereas
for closed environments using the package recipe is absolutely fine.

My plan is to make 1.1 the default with the 0.8.5 release, so that there
is still some time for derived distros to catch up (and for more people
to upgrade).

Re: Ubuntu 18.04 linking problem

On Sat, 26 May 2018 09:39:13 +0200, Sönke Ludwig wrote:

Am 25.05.2018 um 23:59 schrieb Carl Sturtivant:

Just made the hello project dub init hello --type:vibe.d.
I do have libssl-dev installed: 1.1.0g-2ubuntu4 the default for Ubuntu 18.04 which I had to install explicitly, else linking failed saying libssl and libcrypto could not be found.
Everything builds with dmd 2.080.0, but linking fails as below. Please help.

Linking...
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl_f0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext6__ctorMFNfEQBwQBu3tls14TLSContextKindEQCxQCvQBb10TLSVersionZ9__lambda3MFNbNeZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:467: undefined reference to `SSLv23_client_method'
(...)

Ubuntu 18.04 has switched to OpenSSL 1.1.x, which means that the
corresponding "openssl-1.1" configuration of vibe-d:tls now needs to be
selected. There are two possible ways, using the command line or using
the package recipe.

The command line way is "dub --override-config=vibe-d:tls/openssl-1.1",
using the package recipe is described in the [HTTPS section of the
docs][1]. For public packages I'd recommend to stick with the command
line switch, so that the end user keeps the full flexibility, whereas
for closed environments using the package recipe is absolutely fine.

My plan is to make 1.1 the default with the 0.8.5 release, so that there
is still some time for derived distros to catch up (and for more people
to upgrade).

[1]: http://vibed.org/docs#http-https

Thanks, I'm really happy that OpenSSL 1.1.x is already currently supported.

Re: Ubuntu 18.04 linking problem

On Sat, 26 May 2018 09:39:13 +0200, Sönke Ludwig wrote:

Am 25.05.2018 um 23:59 schrieb Carl Sturtivant:

Just made the hello project dub init hello --type:vibe.d.
I do have libssl-dev installed: 1.1.0g-2ubuntu4 the default for Ubuntu 18.04 which I had to install explicitly, else linking failed saying libssl and libcrypto could not be found.
Everything builds with dmd 2.080.0, but linking fails as below. Please help.

Linking...
../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/.dub/build/openssl-debug-linux.posix-x86_64-dmd_2080-3B2D6460E8C1CDAAD90DC538F2C96CA8/libvibe-d_tls.a(openssl_f0_569.o): In function `_D4vibe6stream7openssl14OpenSSLContext6__ctorMFNfEQBwQBu3tls14TLSContextKindEQCxQCvQBb10TLSVersionZ9__lambda3MFNbNeZv':
/home/carl/Documents/vibed/hello/../../../.dub/packages/vibe-d-0.8.3/vibe-d/tls/vibe/stream/openssl.d:467: undefined reference to `SSLv23_client_method'
(...)

Ubuntu 18.04 has switched to OpenSSL 1.1.x, which means that the
corresponding "openssl-1.1" configuration of vibe-d:tls now needs to be
selected. There are two possible ways, using the command line or using
the package recipe.

The command line way is "dub --override-config=vibe-d:tls/openssl-1.1",
using the package recipe is described in the [HTTPS section of the
docs][1]. For public packages I'd recommend to stick with the command
line switch, so that the end user keeps the full flexibility, whereas
for closed environments using the package recipe is absolutely fine.

My plan is to make 1.1 the default with the 0.8.5 release, so that there
is still some time for derived distros to catch up (and for more people
to upgrade).

[1]: http://vibed.org/docs#http-https

Hi Sönke, I had the same problem, so I followed your advice here but I got this result:

andi@andi-PC:~/vibe/hello$ dub --override-config=vibe-d:tls/openssl-1.1
Performing "debug" build using /usr/bin/dmd for x86.
taggedalgebraic 0.10.11: building configuration "library"...
eventcore 0.8.35: building configuration "epoll"...
stdx-allocator 2.77.2: building configuration "library"...
vibe-core 1.4.0: building configuration "epoll"...
vibe-d:utils 0.8.4: building configuration "library"...
vibe-d:data 0.8.4: building configuration "library"...
mir-linux-kernel 1.0.0: target for configuration "library" is up to date.
vibe-d:crypto 0.8.4: building configuration "library"...
diet-ng 1.5.0: target for configuration "library" is up to date.
vibe-d:stream 0.8.4: building configuration "library"...
vibe-d:textfilter 0.8.4: building configuration "library"...
vibe-d:inet 0.8.4: building configuration "library"...
vibe-d:tls 0.8.4: building configuration "openssl-1.1"...
vibe-d:http 0.8.4: building configuration "library"...
vibe-d:mail 0.8.4: building configuration "library"...
vibe-d:mongodb 0.8.4: building configuration "library"...
../../.dub/packages/vibe-d-0.8.4/vibe-d/mongodb/vibe/db/mongo/settings.d(16,8): Deprecation: alias `std.digest.digest.toHexString` is deprecated - import std.digest instead of std.digest.digest. std.digest.digest will be removed in 2.084
../../.dub/packages/vibe-d-0.8.4/vibe-d/mongodb/vibe/db/mongo/settings.d(16,8): Deprecation: alias `std.digest.digest.toHexString` is deprecated - import std.digest instead of std.digest.digest. std.digest.digest will be removed in 2.084
vibe-d:redis 0.8.4: building configuration "library"...
vibe-d:web 0.8.4: building configuration "library"...
vibe-d 0.8.4: building configuration "vibe-core"...
hello ~master: building configuration "application"...
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Running ./hello 
Program exited with code -11

So checked if i have libssl-dev:

andi@andi-PC:~/vibe/hello$ sudo apt install libssl-dev
[sudo] password for andi: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libssl-dev is already the newest version (1.1.0g-2ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I am using a niece's old computer with a newly-installed Ubuntu Budgie 18.04 32-bit and I don't know what I missed. Thanks for your help.