RejectedSoftware Forums

Sign up

Linker errors

Hi - vibe newbie here. Can someone shine some light on what's going wrong here and how to fix it.

Using current DMD, current DUB on Win 10.

Thanks for any help!

D:\projects\d2\apitest>dub init hello -t vibe.d
Package recipe format (sdl/json) [json]:
Name [hello]:
Description [A simple vibe.d server application.]:
Author name [kpeters]:
License [proprietary]:
Copyright string [Copyright © 2018, kpeters]:
Add dependency (leave empty to skip) []:
Successfully created an empty project in 'D:\projects\d2\apitest\hello'.
Package successfully created in hello

D:\projects\d2\apitest>cd hello

D:\projects\d2\apitest\hello>dir
Volume in drive D is Evo500
Volume Serial Number is 9E1A-B498

Directory of D:\projects\d2\apitest\hello

17.10.2018 01:58 PM <DIR> .
17.10.2018 01:58 PM <DIR> ..
17.10.2018 01:58 PM 118 .gitignore
17.10.2018 01:58 PM 221 dub.json
17.10.2018 01:58 PM <DIR> public
17.10.2018 01:58 PM <DIR> source
17.10.2018 01:58 PM <DIR> views

   2 File(s)            339 bytes
   5 Dir(s)  488,412,516,352 bytes free

D:\projects\d2\apitest\hello>dub -a x8664
Fetching stdx-allocator 2.77.4 (getting selected version)...
Fetching libevent 2.0.2+2.0.16 (getting selected version)...
Fetching diet-ng 1.5.0 (getting selected version)...
Fetching botan-math 1.0.3 (getting selected version)...
Fetching openssl 1.1.6+1.0.1g (getting selected version)...
Fetching botan 1.12.10 (getting selected version)...
Fetching eventcore 0.8.36 (getting selected version)...
Fetching memutils 0.4.13 (getting selected version)...
Fetching vibe-d 0.8.4 (getting selected version)...
Fetching mir-linux-kernel 1.0.1 (getting selected version)...
Fetching vibe-core 1.4.3 (getting selected version)...
Fetching taggedalgebraic 0.10.11 (getting selected version)...
Fetching libasync 0.8.3 (getting selected version)...
Performing "debug" build using C:\D2\dmd2\windows\bin\dmd.exe for x86
64.
taggedalgebraic 0.10.11: building configuration "library"...
eventcore 0.8.36: building configuration "winapi"...
stdx-allocator 2.77.4: building configuration "library"...
vibe-core 1.4.3: building configuration "winapi"...
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\core.d(692,70): Deprecation: std.algorithm.setops.No is not visible from module core
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(33,23): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(50,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(51,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(67,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(68,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(847,14): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(852,9): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(860,13): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(861,10): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(865,10): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(869,11): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(870,11): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(871,11): Deprecation: opDot is deprecated. Use alias this
vibe-d:utils 0.8.4: building configuration "library"...
vibe-d:data 0.8.4: building configuration "library"...
mir-linux-kernel 1.0.1: building configuration "library"...
vibe-d:crypto 0.8.4: building configuration "library"...
diet-ng 1.5.0: building configuration "library"...
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-mscoff"...
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"...
C:\Users\kpeters\AppData\Local\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
C:\Users\kpeters\AppData\Local\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...
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open libcmt.lib: no such file or directory
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open OLDNAMES.lib: no such file or directory
Error: linker exited with status 1
C:\D2\dmd2\windows\bin\dmd.exe failed with exit code 1.

D:\projects\d2\apitest\hello>

Re: Linker errors

Am 17.10.2018 um 23:07 schrieb K. P.:

Hi - vibe newbie here. Can someone shine some light on what's going wrong here and how to fix it.

Using current DMD, current DUB on Win 10.

Thanks for any help!

(...)
D:\projects\d2\apitest\hello>dub -a x86_64
(...)
Linking...
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open libcmt.lib: no such file or directory
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open OLDNAMES.lib: no such file or directory
Error: linker exited with status 1
C:\D2\dmd2\windows\bin\dmd.exe failed with exit code 1.

D:\projects\d2\apitest\hello>

It's using the LLD linker, which was added recently as an experimental
alternative to the Microsoft linker. I haven't tried it yet, so I'm not
sure how well it works, but you could try to build with -a x86_mscoff
to see if 32-bit builts work properly.

Alternatively, you'd have to go the classic path and install the C++
tools of VisualStudio (community edition). DMD should then automatically
pick up the Microsoft linker. LDC2 also works as an alternative on Windows.

Re: Linker errors

On Tue, 23 Oct 2018 20:16:28 +0200, Sönke Ludwig wrote:

Am 17.10.2018 um 23:07 schrieb K. P.:

Hi - vibe newbie here. Can someone shine some light on what's going wrong here and how to fix it.

Using current DMD, current DUB on Win 10.

Thanks for any help!

(...)
D:\projects\d2\apitest\hello>dub -a x86_64
(...)
Linking...
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open libcmt.lib: no such file or directory
C:\D2\dmd2\windows\bin\lld-link.exe: error: could not open OLDNAMES.lib: no such file or directory
Error: linker exited with status 1
C:\D2\dmd2\windows\bin\dmd.exe failed with exit code 1.

D:\projects\d2\apitest\hello>

It's using the LLD linker, which was added recently as an experimental
alternative to the Microsoft linker. I haven't tried it yet, so I'm not
sure how well it works, but you could try to build with -a x86_mscoff
to see if 32-bit builts work properly.

Alternatively, you'd have to go the classic path and install the C++
tools of VisualStudio (community edition). DMD should then automatically
pick up the Microsoft linker. LDC2 also works as an alternative on Windows.

Thanks for your help - much appreciated. It worked fine - alas ... there are quite a number of warnings

...
...
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\core.d(692,70): Deprecation: std.algorithm.setops.No is not visible from module core
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(33,23): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(50,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(51,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(67,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(68,3): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(847,14): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(852,9): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(860,13): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(861,10): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(865,10): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(869,11): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(870,11): Deprecation: opDot is deprecated. Use alias this
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\log.d(871,11):
...
...
C:\Users\kpeters\AppData\Local\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
C:\Users\kpeters\AppData\Local\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

Linking...
vibe-d_web.lib(common.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(driver.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(driver.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(core.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
Copying files for vibe-d:tls...

Do they hail from compiler upgrades that are not yet handled in the vibe sources? Or are there any other legitimate reasons for these peskies? If compiler 'incompatibility', when can we expect a version that is in synch with the compiler progress?

Finally, a thing that puzzles me: I build my little server, run it successfully, then Ctrl-C it and get my Windows command prompt back. When I then try to delete the exe I just built, I get 'Access denied'. I have to end the command prompt that spawned the exe in order to being able to delete the exe - what's going on??

Thanks for again for anyone who can shed light on either or both of my questions.

Cheers,
Kai

Re: Linker errors

Am 27.10.2018 um 04:41 schrieb Kai:> On Tue, 23 Oct 2018 20:16:28 +0200, Sönke Ludwig wrote:

Am 17.10.2018 um 23:07 schrieb K. P.:
(...) - alas ... there are quite a number of warnings

(...)
C:\Users\kpeters\AppData\Local\dub\packages\vibe-core-1.4.3\vibe-core\source\vibe\core\core.d(692,70): Deprecation: std.algorithm.setops.No is not visible from module core
(...)

I just tagged vibe-core 1.4.4 yesterday with all warnings on the latest DMD fixed. A dub upgrade should get rid of these.

(...)
C:\Users\kpeters\AppData\Local\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
C:\Users\kpeters\AppData\Local\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

Linking...
vibe-d_web.lib(common.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(driver.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(driver.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
eventcore.lib(core.obj) : warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info
Copying files for vibe-d:tls...

I still have to fix the toHexString one, didn't notice it up to now. The linker warnings can safely be ignored, though. They are a rather silly limitation caused by the way how object files are generated by the compiler, but unless anything crashes within eventcore this will not have any visible side effect.

Do they hail from compiler upgrades that are not yet handled in the vibe sources? Or are there any other legitimate reasons for these peskies? If compiler 'incompatibility', when can we expect a version that is in synch with the compiler progress?

Finally, a thing that puzzles me: I build my little server, run it successfully, then Ctrl-C it and get my Windows command prompt back. When I then try to delete the exe I just built, I get 'Access denied'. I have to end the command prompt that spawned the exe in order to being able to delete the exe - what's going on??

Windows detaches the terminal from the process when pressing Ctrl+C once (press twice to kill the process). It seems like the Ctrl+C handler in vibe-core did not manage to properly shut down the process. That could actually be fixed by vibe-core 1.4.4 if any worker threads/tasks are used by the server. If not, does that also happen with the examples/http-server project in vibe-d for you? I'd try to reproduce that locally then.

Thanks for again for anyone who can shed light on either or both of my questions.

Cheers,
Kai

Re: Linker errors

On Mon, 29 Oct 2018 09:37:48 GMT, Sönke Ludwig wrote:

Windows detaches the terminal from the process when pressing Ctrl+C once (press twice to kill the process). It seems like the Ctrl+C handler in vibe-core did not manage to properly shut down the process. That could actually be fixed by vibe-core 1.4.4 if any worker threads/tasks are used by the server. If not, does that also happen with the examples/http-server project in vibe-d for you? I'd try to reproduce that locally then.

Yes, it happens there as well.

Re: Linker errors

Am 29.10.2018 um 20:07 schrieb Kai:

On Mon, 29 Oct 2018 09:37:48 GMT, Sönke Ludwig wrote:

Windows detaches the terminal from the process when pressing Ctrl+C once (press twice to kill the process). It seems like the Ctrl+C handler in vibe-core did not manage to properly shut down the process. That could actually be fixed by vibe-core 1.4.4 if any worker threads/tasks are used by the server. If not, does that also happen with the examples/http-server project in vibe-d for you? I'd try to reproduce that locally then.

Yes, it happens there as well.

I opened a PR to fix this, which will be in the next vibe-core version:
https://github.com/vibe-d/vibe-core/pull/99

When running the example now, it exits properly, except for a warning
that socket descriptors have been leaked. This is because the example
does not call stopListening on the HTTPListener returned by
listenHTTP, and the warning messages have just been introduced. I'll
post a fix for that, too.