RejectedSoftware Forums

Sign up

Problem with simple example

app.d:

import vibe.d;

shared static this()
{
	listenTCP(7, (conn){ conn.write(conn) });
}

error:

D:\Project\2014\JSONServer>dub
Target vibe-d 0.7.21 is up to date. Use --force to rebuild.
Building jsonserver ~master configuration "application", build type debug.
Compiling using dmd...
source\app.d(5): Error: found '}' when expecting ';' following statement
source\app.d(5): Error: found ')' instead of statement
source\app.d(6): Error: found 'EOF' when expecting ','
source\app.d(6): Error: found 'EOF' when expecting ')'
source\app.d(6): Error: found 'EOF' when expecting ';' following statement
source\app.d(6): Error: found 'EOF' when expecting '}' following compound statem
ent
source\foo.d(5): Error: found '}' when expecting ';' following statement
source\foo.d(5): Error: found ')' instead of statement
source\foo.d(6): Error: found 'EOF' when expecting ','
source\foo.d(6): Error: found 'EOF' when expecting ')'
source\foo.d(6): Error: found 'EOF' when expecting ';' following statement
source\foo.d(6): Error: found 'EOF' when expecting '}' following compound statem
ent
FAIL .dub\build\application-debug-windows-x86-dmd_2066-FA6EE492E7D811DFCB02C2EFC
AFB2E17\ jsonserver executable
Error executing command run: dmd failed with exit code 1.

Re: Problem with simple example

Strange! I tested it on my home PC and there is no any problems like above. But there is another issue:

The following changes will be performed:
Fetch libevent >=2.0.1+2.0.16 <2.1.0, userWide
Fetch vibe-d >=0.7.17, userWide
Fetch openssl >=1.0.0+1.0.0e, userWide
Fetch libev >=4.0.0+4.04 <4.1.0, userWide
Fetching libevent 2.0.1+2.0.16...
Fetching libevent 2.0.1+2.0.16...
Error executing command run: Failed to download http://code.dlang.org/packages/l
ibevent/2.0.1%252B2.0.16.zip: 404 Not Found

How to fix it?

Re: Problem with simple example

On Mon, 24 Nov 2014 16:19:52 GMT, Suliman wrote:

Strange! I tested it on my home PC and there is no any problems like above. But there is another issue:

The following changes will be performed:
Fetch libevent >=2.0.1+2.0.16 <2.1.0, userWide
Fetch vibe-d >=0.7.17, userWide
Fetch openssl >=1.0.0+1.0.0e, userWide
Fetch libev >=4.0.0+4.04 <4.1.0, userWide
Fetching libevent 2.0.1+2.0.16...
Fetching libevent 2.0.1+2.0.16...
Error executing command run: Failed to download http://code.dlang.org/packages/l
ibevent/2.0.1%252B2.0.16.zip: 404 Not Found

How to fix it?

This is an issue with your version of dub with a buggy url encoding metho. Download the latest at code.dlang.org

As for the other problem, you seemed to be missing a semicolon after your statement. (conn) { conn.write(...); }