www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Vibe.d v0.9.0, v0.10.0: ` dub init hello -t vibe.d` fails to build on

reply Ki Rill <rill.ki yahoo.com> writes:
I follow vibe.d tutorial by 
[reyvaleza](https://reyvaleza.gitbook.io/vibe.d-tutorial/the-default-hello-world-app):
```sh
$ dub init hello -t vibe.d
$ cd hello
$ dub
```

Output:
```sh
      Pre-gen Running commands for openssl
     Starting Performing "debug" build using dmd for x86_64.
   Up-to-date diet-ng 1.8.1: target for configuration [library] is 
up to date.
   Up-to-date taggedalgebraic 0.11.23: target for configuration 
[library] is up to date.
   Up-to-date eventcore 0.9.30: target for configuration 
[cfrunloop] is up to date.
   Up-to-date stdx-allocator 2.77.5: target for configuration 
[library] is up to date.
   Up-to-date vibe-container 1.3.1: target for configuration 
[library] is up to date.
   Up-to-date vibe-core 2.8.5: target for configuration 
[cfrunloop] is up to date.
   Up-to-date vibe-inet:textfilter 1.0.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-serialization 1.0.4: target for configuration 
[library] is up to date.
   Up-to-date vibe-stream 1.1.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-inet 1.0.0: target for configuration [library] 
is up to date.
   Up-to-date mir-linux-kernel 1.0.1: target for configuration 
[library] is up to date.
   Up-to-date vibe-inet:crypto 1.0.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-stream:tls 1.1.0: target for configuration 
[openssl] is up to date.
   Up-to-date vibe-http 1.1.0: target for configuration [library] 
is up to date.
   Up-to-date vibe-d:mail 0.10.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-d:mongodb 0.10.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-d:redis 0.10.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-d:utils 0.10.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-d:web 0.10.0: target for configuration 
[library] is up to date.
   Up-to-date vibe-d 0.10.0: target for configuration [library] is 
up to date.
     Building hello ~master: building configuration [application]
      Linking hello
Undefined symbols for architecture x86_64:
   "_ERR_new", referenced from:
       __D4vibe6stream7openssl11setSSLErrorFNbNeAyaQdiQgZv in 
libvibe-stream_tls.a(openssl_1f9_448.o)
   "_ERR_set_debug", referenced from:
       __D4vibe6stream7openssl11setSSLErrorFNbNeAyaQdiQgZv in 
libvibe-stream_tls.a(openssl_1f9_448.o)
   "_ERR_set_error", referenced from:
       __D4vibe6stream7openssl11setSSLErrorFNbNeAyaQdiQgZv in 
libvibe-stream_tls.a(openssl_1f9_448.o)
   "_SSL_get1_peer_certificate", referenced from:
       
__D4vibe6stream7openssl13OpenSSLStream6__ctorMFNfSQBv8internal14interfaceproxy__T14InterfaceProxyTCQDs4coreQDv6StreamZQBlCQEpQEnQEj14OpenSSLContextEQFpQFn3tls14TLSStreamStateAyaSQGtQDb3net14NetworkAddressAQBfZ10__lambda18MFNbNeZPS6dei
osQIo5types7x509_st in libvibe-stream_tls.a(openssl_1ec_4f0.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: undefined reference to `_ERR_new`
Error: undefined reference to `_ERR_set_debug`
Error: undefined reference to `_ERR_set_error`
Error: undefined reference to `_SSL_get1_peer_certificate`
        perhaps a library needs to be added with the `-L` flag or 
`pragma(lib, ...)`
Error: linker exited with status 1
        cc 
/Users/rillki/.dub/cache/hello/~master/build/application-debug-YL3P8PyeIX
TPy3UUgCigQ/hello.o -o
/Users/rillki/.dub/cache/hello/~master/build/application-debug-YL3P8Pye
XmTPy3UUgCigQ/hello -g -m64 -Xlinker -no_compact_unwind -Xlinker -framework
-Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker
-framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices
-Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker
CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework
-Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker
-framework -Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation
-Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker
CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker -framework
-Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker
-framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices
-Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker
CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework
-Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker
-framework -Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation
-Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker
CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker -framework
-Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker
-framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices
-Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker
CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework
-Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker
-framework -Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation
-Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker
CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker -framework
-Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices -Xlinker
-framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker CoreServices
-Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework -Xlinker
CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker -framework
-Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation -Xlinker
-framework -Xlinker CoreServices -Xlinker -framework -Xlinker CoreFoundation
-Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker
CoreFoundation -Xlinker -framework -Xlinker CoreServices
../../.dub/cache/vibe-d/0.10.0/build/library-debug-g1lwC9oTSuj0E
Ki5a88zQ/libvibed.a ../../.dub/cache/vibe-d/0.10.0/+mail/build/library-debug-AOm94-Q5A3-Ii47AS5u
iA/libvibe-d_mail.a ../../.dub/cache/vibe-d/0.10.0/+mongodb/build/library-debug-Cuh56lxuIvNOrEzVbad13w
libvibe-d_mongodb.a ../../.dub/cache/vibe-d/0.10.0/+redis/build/library-debug-BgFwHl_nuMmPSlfnbIlX
A/libvibe-d_redis.a ../../.dub/cache/vibe-d/0.10.0/+web/build/library-debug-8XPuAyuS5ZXa1HtQXb
dtg/libvibe-d_web.a ../../.dub/cache/vibe-d/0.10.0/+utils/build/library-debug-lXwZdAd4zVPimo5vbKE8
w/libvibe-d_utils.a ../../.dub/cache/vibe-http/1.1.0/build/library-debug-XQ0vmbAGrZ_QXcUNl
TYTg/libvibe-http.a ../../.dub/cache/diet-ng/1.8.1/build/library-debug-Lp3ZEcx7dSuUprb
rcEoLA/libdiet-ng.a ../../.dub/cache/vibe-inet/1.0.0/build/library-debug-xw8vadh_Vlg6hQY8b
5YuQ/libvibe-inet.a ../../.dub/cache/vibe-inet/1.0.0/+textfilter/build/library-debug-yptDu1jzhPlJiR32QzChjw/libvi
e-inet_textfilter.a ../../.dub/cache/vibe-serialization/1.0.4/build/library-debug-21ht2wTy2J9X2ZPmQRs0eA/lib
ibe-serialization.a ../../.dub/cache/vibe-inet/1.0.0/+crypto/build/library-debug-qdZDX17mub0iJpWQy7Zfpg/l
bvibe-inet_crypto.a ../../.dub/cache/mir-linux-kernel/1.0.1/build/library-debug-qNurHACkZt8LQU_ZThWaJA/l
bmir-linux-kernel.a ../../.dub/cache/vibe-stream/1.1.0/+tls/build/openssl-debug-p9NLKJHZMqkOZy4LjTZmkA/
ibvibe-stream_tls.a ../../.dub/cache/vibe-stream/1.1.0/build/library-debug-AaFD56-zfiQeh6rvhU4
vg/libvibe-stream.a ../../.dub/cache/vibe-core/2.8.5/build/cfrunloop-debug-HtkJDWziCJ8N2L8UF
j-6Q/libvibe_core.a ../../.dub/cache/eventcore/0.9.30/build/cfrunloop-debug-Xog3q5femZHeQULql
-KUQ/libeventcore.a ../../.dub/cache/taggedalgebraic/0.11.23/build/library-debug-jib9rlbUhg6hVqWGBHd0Xw/
ibtaggedalgebraic.a ../../.dub/cache/vibe-container/1.3.1/build/library-debug-64fXjI5WEGko5OU5kJXFrw
libvibe-container.a ../../.dub/cache/stdx-allocator/2.77.5/build/library-debug-JTLsrDN5lJb-86S-S2_9-Q
libstdx-allocator.a -L/usr/local/opt/openssl 1.1/lib
-L/usr/local/opt/openssl/lib -L/usr/local/opt/openssl 1.1/lib
-L/usr/local/opt/openssl/lib -L/usr/local/opt/openssl 1.1/lib
-L/usr/local/opt/openssl/lib -L/usr/local/opt/openssl 1.1/lib
-L/usr/local/opt/openssl/lib -L/usr/local/opt/openssl 1.1/lib
-L/usr/local/opt/openssl/lib -L/usr/local/Cellar/openssl 3/3.3.1/lib -lssl
-lcrypto -L/usr/local/opt/dmd/lib -lphobos2 -lpthread -lm
```

dub.json:
```json
{
	"authors": [
		"rillki"
	],
	"copyright": "Copyright © 2024, rillki",
	"dependencies": {
		"vibe-d": "~>0.9"
	},
	"description": "A simple vibe.d server application.",
	"license": "MIT",
	"name": "hello"
}
```

Machine:
```
MacBook Pro (Retina, 15-inch, Late 2013), macOS Big Sur version 
11.7.10
```

How should I solve this? It mentions undefined symbols from 
openssl, but I have it installed. Vibe.d should link it 
automatically, right?
Jul 07
parent reply Sergey <kornburn yandex.ru> writes:
On Sunday, 7 July 2024 at 10:55:21 UTC, Ki Rill wrote:
 Machine:
 ```
 MacBook Pro (Retina, 15-inch, Late 2013), macOS Big Sur version 
 11.7.10
 ```

 How should I solve this? It mentions undefined symbols from 
 openssl, but I have it installed. Vibe.d should link it 
 automatically, right?
You can try to add to dependencies "vibe-stream:tls": "~>1.1.0" and ``` "subConfigurations": { "vibe-stream:tls": "notls" } ```
Jul 07
parent reply Ki Rill <rill.ki yahoo.com> writes:
On Sunday, 7 July 2024 at 11:33:47 UTC, Sergey wrote:
 On Sunday, 7 July 2024 at 10:55:21 UTC, Ki Rill wrote:
 Machine:
 ```
 MacBook Pro (Retina, 15-inch, Late 2013), macOS Big Sur 
 version 11.7.10
 ```

 How should I solve this? It mentions undefined symbols from 
 openssl, but I have it installed. Vibe.d should link it 
 automatically, right?
You can try to add to dependencies "vibe-stream:tls": "~>1.1.0" and ``` "subConfigurations": { "vibe-stream:tls": "notls" } ```
It worked, thank you! But what does it do; disables TLS? Thread Local Storage?
Jul 07
next sibling parent Sergey <kornburn yandex.ru> writes:
On Sunday, 7 July 2024 at 14:15:02 UTC, Ki Rill wrote:
 It worked, thank you! But what does it do; disables TLS? Thread 
 Local Storage?
It disabling transport layer security IMUC you won't be able to have "https" but only "http". So in case you need that, you can make another SubConfiguration with "openssl" with the proper version, that installed in your system.
Jul 07
prev sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On Sunday, 7 July 2024 at 14:15:02 UTC, Ki Rill wrote:
 On Sunday, 7 July 2024 at 11:33:47 UTC, Sergey wrote:
 On Sunday, 7 July 2024 at 10:55:21 UTC, Ki Rill wrote:
 Machine:
 ```
 MacBook Pro (Retina, 15-inch, Late 2013), macOS Big Sur 
 version 11.7.10
 ```

 How should I solve this? It mentions undefined symbols from 
 openssl, but I have it installed. Vibe.d should link it 
 automatically, right?
You can try to add to dependencies "vibe-stream:tls": "~>1.1.0" and ``` "subConfigurations": { "vibe-stream:tls": "notls" } ```
It worked, thank you! But what does it do; disables TLS? Thread Local Storage?
openssl version should be automatically determined by running a pre-build step. If this doesn't work for you, please file a bug here: https://github.com/D-Programming-Deimos/openssl -Steve
Jul 07
parent Ki Rill <rill.ki yahoo.com> writes:
On Sunday, 7 July 2024 at 23:33:59 UTC, Steven Schveighoffer 
wrote:
 openssl version should be automatically determined by running a 
 pre-build step.

 If this doesn't work for you, please file a bug here: 
 https://github.com/D-Programming-Deimos/openssl

 -Steve
Filed a bug here: https://github.com/D-Programming-Deimos/openssl/issues/112
Jul 07