Thread overview | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 08, 2018 "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
This is the code example, that was presented on the https://dlang.org frontpage: ----------------- #!/usr/bin/env dub /+ dub.sdl: name "hello_vibed" dependency "vibe-d" version="~>0.8.0" +/ void main() { import vibe.d; listenHTTP(":8080", (req, res) { res.writeBody("Hello, World: " ~ req.path); }); runApplication(); } ----------------- I have copied this example code into start_minimum_server.d file. Ran it as script with rdmd.exe And got an output: -------------------------- C:\Users\Vaidas\Desktop>rdmd start_minimum_server.d start_minimum_server.d(8): Error: module `d` is in file 'vibe\d.d' which cannot be read import path[0] = . import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import Failed: ["dmd", "-v", "-o-", "start_minimum_server.d", "-I."] -------------------------- |
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
> This is the code example, that was presented on the https://dlang.org frontpage:
>
> -----------------
> #!/usr/bin/env dub
This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle.
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote: > On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote: >> This is the code example, that was presented on the https://dlang.org frontpage: >> >> ----------------- >> #!/usr/bin/env dub > > This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle. My intuition now says to use dub this way: -------------------------------------- C:\Users\Vaidas\Desktop>dub start_minimum_server.d EC:\D\dmd2\windows\bin\dmd.exe failed with exit code 1. And got an error: Unexpected OPTLINK Termination at EIP=0040F60A EAX=06CB0000 EBX=00438C70 ECX=000002C2 EDX=0000030D ESI=00257000 EDI=06CB34F8 EBP=0019FF38 ESP=0019FEF0 First=00402000 Similar to this one: https://issues.dlang.org/show_bug.cgi?id=18799 |
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote:
> On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote:
>> On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
>>> [...]
>>
>> This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle.
>
> My intuition now says to use dub this way:
> --------------------------------------
> C:\Users\Vaidas\Desktop>dub start_minimum_server.d
> EC:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
>
> And got an error: Unexpected OPTLINK Termination at EIP=0040F60A
> EAX=06CB0000 EBX=00438C70 ECX=000002C2 EDX=0000030D
> ESI=00257000 EDI=06CB34F8 EBP=0019FF38 ESP=0019FEF0
> First=00402000
>
> Similar to this one: https://issues.dlang.org/show_bug.cgi?id=18799
Did you try the newer MSCOFF format
dub --arch=x86_mscoff start_minimum_server.d
or
dub --arch=x64 start_minimum_server.d
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Seb | On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote:
> On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote:
>> On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote:
>>> On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
>>>> [...]
>>>
>>> This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle.
>>
>> My intuition now says to use dub this way:
>> --------------------------------------
>> C:\Users\Vaidas\Desktop>dub start_minimum_server.d
>> EC:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
>>
>> And got an error: Unexpected OPTLINK Termination at EIP=0040F60A
>> EAX=06CB0000 EBX=00438C70 ECX=000002C2 EDX=0000030D
>> ESI=00257000 EDI=06CB34F8 EBP=0019FF38 ESP=0019FEF0
>> First=00402000
>>
>> Similar to this one: https://issues.dlang.org/show_bug.cgi?id=18799
>
> Did you try the newer MSCOFF format
>
> dub --arch=x86_mscoff start_minimum_server.d
>
> or
>
> dub --arch=x64 start_minimum_server.d
C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff start_minimum_server.d
Failed to find a package named 'start_minimum_server.d'.
C:\Users\Vaidas\Desktop>dub --arch=x64 start_minimum_server.d
Unsupported architecture: x64
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | 08.05.2018 16:23, BoQsc пишет:
> On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote:
>> On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote:
>>> On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote:
>>>> On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
>>>>> [...]
>>>>
>>>> This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle.
>>>
>>> My intuition now says to use dub this way:
>>> --------------------------------------
>>> C:\Users\Vaidas\Desktop>dub start_minimum_server.d
>>> EC:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
>>>
>>> And got an error: Unexpected OPTLINK Termination at EIP=0040F60A
>>> EAX=06CB0000 EBX=00438C70 ECX=000002C2 EDX=0000030D
>>> ESI=00257000 EDI=06CB34F8 EBP=0019FF38 ESP=0019FEF0
>>> First=00402000
>>>
>>> Similar to this one: https://issues.dlang.org/show_bug.cgi?id=18799
>>
>> Did you try the newer MSCOFF format
>>
>> dub --arch=x86_mscoff start_minimum_server.d
>>
>> or
>>
>> dub --arch=x64 start_minimum_server.d
>
> C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff start_minimum_server.d
> Failed to find a package named 'start_minimum_server.d'.
>
> C:\Users\Vaidas\Desktop>dub --arch=x64 start_minimum_server.d
> Unsupported architecture: x64
didn't you forget `--single` option?
```
dub --arch=x64 --single start_minimum_server.d
```
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to drug | On Tuesday, 8 May 2018 at 13:33:51 UTC, drug wrote: > 08.05.2018 16:23, BoQsc пишет: >> On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote: >>> On Tuesday, 8 May 2018 at 12:37:42 UTC, BoQsc wrote: >>>> On Tuesday, 8 May 2018 at 12:19:14 UTC, Adam D. Ruppe wrote: >>>>> On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote: >>>>>> [...] >>>>> >>>>> This one needs to be compiled+run with the dub package manager instead of with rdmd, which is why it has that shebang line. It has external library dependencies rdmd can't handle. >>>> >>>> My intuition now says to use dub this way: >>>> -------------------------------------- >>>> C:\Users\Vaidas\Desktop>dub start_minimum_server.d >>>> EC:\D\dmd2\windows\bin\dmd.exe failed with exit code 1. >>>> >>>> And got an error: Unexpected OPTLINK Termination at EIP=0040F60A >>>> EAX=06CB0000 EBX=00438C70 ECX=000002C2 EDX=0000030D >>>> ESI=00257000 EDI=06CB34F8 EBP=0019FF38 ESP=0019FEF0 >>>> First=00402000 >>>> >>>> Similar to this one: https://issues.dlang.org/show_bug.cgi?id=18799 >>> >>> Did you try the newer MSCOFF format >>> >>> dub --arch=x86_mscoff start_minimum_server.d >>> >>> or >>> >>> dub --arch=x64 start_minimum_server.d >> >> C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff start_minimum_server.d >> Failed to find a package named 'start_minimum_server.d'. >> >> C:\Users\Vaidas\Desktop>dub --arch=x64 start_minimum_server.d >> Unsupported architecture: x64 > > didn't you forget `--single` option? > ``` > dub --arch=x64 --single start_minimum_server.d > ``` C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff --single start_minimum_server.d Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for x86, x86_mscoff. taggedalgebraic 0.10.11: building configuration "library"... eventcore 0.8.34: building configuration "winapi"... stdx-allocator 2.77.1: building configuration "library"... vibe-core 1.4.0: building configuration "winapi"... vibe-d:utils 0.8.3: building configuration "library"... vibe-d:data 0.8.3: building configuration "library"... vibe-d:crypto 0.8.3: building configuration "library"... diet-ng 1.4.5: building configuration "library"... vibe-d:stream 0.8.3: building configuration "library"... vibe-d:textfilter 0.8.3: building configuration "library"... vibe-d:inet 0.8.3: building configuration "library"... vibe-d:tls 0.8.3: building configuration "openssl-mscoff"... vibe-d:http 0.8.3: building configuration "library"... vibe-d:mail 0.8.3: building configuration "library"... vibe-d:mongodb 0.8.3: building configuration "library"... vibe-d:redis 0.8.3: building configuration "library"... vibe-d:web 0.8.3: building configuration "library"... vibe-d 0.8.3: building configuration "vibe-core"... hello_vibed ~master: building configuration "application"... Linking... C:\D\dmd2\windows\bin\lld-link.exe: warning: phobos32mscoff.lib(crc32.obj): undefined symbol: __allshr error: link failed Error: linker exited with status 1 C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1. C:\Users\Vaidas\Desktop> |
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | On Tue, 08 May 2018 13:23:07 +0000, BoQsc wrote:
> On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote:
>>
>> Did you try the newer MSCOFF format
>>
>> dub --arch=x86_mscoff start_minimum_server.d
>>
>> or
>>
>> dub --arch=x64 start_minimum_server.d
>
> C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff start_minimum_server.d Failed to find a package named 'start_minimum_server.d'.
>
> C:\Users\Vaidas\Desktop>dub --arch=x64 start_minimum_server.d Unsupported architecture: x64
Try the 64-bit build as "--arch=x86_64"; dub doesn't recognize x64 (at least on Windows).
dub --arch=x86_64 --single start_minimum_server.d
For your first attempt above, adding the --single flag might work.
--Ryan
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | On Tuesday, 8 May 2018 at 12:13:56 UTC, BoQsc wrote:
>
> This is the code example, that was presented on the https://dlang.org frontpage:
Maybe that isn't the best choice of beginner example if even the D experts can't figure out how to get it to run.
|
May 08, 2018 Re: "Start a Minimal web server" example do not work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to rjframe | On Tuesday, 8 May 2018 at 16:02:02 UTC, rjframe wrote: > On Tue, 08 May 2018 13:23:07 +0000, BoQsc wrote: > >> On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote: >>> >>> Did you try the newer MSCOFF format >>> >>> dub --arch=x86_mscoff start_minimum_server.d >>> >>> or >>> >>> dub --arch=x64 start_minimum_server.d >> >> C:\Users\Vaidas\Desktop>dub --arch=x86_mscoff start_minimum_server.d Failed to find a package named 'start_minimum_server.d'. >> >> C:\Users\Vaidas\Desktop>dub --arch=x64 start_minimum_server.d Unsupported architecture: x64 > > Try the 64-bit build as "--arch=x86_64"; dub doesn't recognize x64 (at least on Windows). > > dub --arch=x86_64 --single start_minimum_server.d > > For your first attempt above, adding the --single flag might work. > > > --Ryan C:\Users\Vaidas\Desktop>dub --arch=x86_64 --single start_minimum_server.d Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for x86_64. taggedalgebraic 0.10.11: building configuration "library"... eventcore 0.8.34: building configuration "winapi"... stdx-allocator 2.77.1: building configuration "library"... vibe-core 1.4.0: building configuration "winapi"... vibe-d:utils 0.8.3: building configuration "library"... vibe-d:data 0.8.3: building configuration "library"... vibe-d:crypto 0.8.3: building configuration "library"... diet-ng 1.4.5: building configuration "library"... vibe-d:stream 0.8.3: building configuration "library"... vibe-d:textfilter 0.8.3: building configuration "library"... vibe-d:inet 0.8.3: building configuration "library"... vibe-d:tls 0.8.3: building configuration "openssl-mscoff"... vibe-d:http 0.8.3: building configuration "library"... vibe-d:mail 0.8.3: building configuration "library"... vibe-d:mongodb 0.8.3: building configuration "library"... vibe-d:redis 0.8.3: building configuration "library"... vibe-d:web 0.8.3: building configuration "library"... vibe-d 0.8.3: building configuration "vibe-core"... hello_vibed ~master: building configuration "application"... Linking... C:\D\dmd2\windows\bin\lld-link.exe: warning: eventcore.lib(sockets_1034_952.obj): undefined symbol: SetWindowLongPtrA C:\D\dmd2\windows\bin\lld-link.exe: warning: eventcore.lib(sockets_1034_952.obj): undefined symbol: GetWindowLongPtrA error: link failed Error: linker exited with status 1 C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1. C:\Users\Vaidas\Desktop> |
Copyright © 1999-2021 by the D Language Foundation