Vibe.d & DUB

Sönke Ludwig sludwig at outerproduct.org
Mon Nov 18 10:15:33 PST 2013


Am 18.11.2013 17:43, schrieb Chris:
> Based on "examples/http_server" I get the following errors when I add an
> external source file:
> 
> source/app.d(26): Error: module app function
> vibe.http.server.handleRequest is private
> source/app.d(26): Error: function vibe.http.server.listenHTTP
> (HTTPServerSettings settings, void delegate(HTTPServerRequest req,
> HTTPServerResponse res) request_handler) is not callable using argument
> types (HTTPServerSettings, bool function(Stream http_stream,
> TCPConnection tcp_connection, HTTPServerListener listen_info, ref
> HTTPServerSettings settings, ref bool keep_alive))
> Error: DMD compile run failed with exit code 1
> 
> "sourceFiles": [
>     "../../project/module/sourcefile.d"
> ],
> 
> I also link to a library I copied to "source/lib" in the server-project
> folder.
> 
> If I exclude the reference from package.config and from app.d it works
> perfectly fine.
> 
> If I include the external file and exclude the line
> "listenHTTP(settings, &handleRequest);", it compiles (but of course does
> nothing.
> 
> I couldn't find anything on google nor in the documentation about
> vibe.http.server.listenHTTP
> 
> Something trivial, I suppose, but I cannot find it.

It seems like it picks up the private vibe.http.server.handleRequest
function instead of your own callback function. Maybe a typo or a
forgotten import? If not, you could try to use a fully qualified name
(i.e. "yourmodule.handleRequest").

/OT: What happened to
https://github.com/D-Programming-Language/dmd/pull/2256?


More information about the Digitalmars-d mailing list