For example, I don't like that there seems to be no way to add the -version=VibeCustomMain using command-line switches without modifying dub.json.

For now, I decided to compile vibe.d itself with Dub. I just modified it a little:

    ...
    "dflags": ["-version=VibeCustomMain"]
}

After it, I ran dub build and got libvibe-d.a in the directory.

(This is another reason why I don't like Dub: it always works in current directory. I prefer to have sources in one place and build results in another.)

On Fri, 27 Jun 2014 14:43:17 GMT, Sönke Ludwig wrote:

On Fri, 27 Jun 2014 14:10:53 GMT, Maaaks wrote:

All manuals say that vibe.d should be used as a dependency in Dub projects, but Dub seems not very convenient to me for a few reasons. I'm looking for a simple tutorial how to use vibe.d without Dub.

It would definitely be interesting to know if there are any things that could be improved here to make DUB more convenient!

Currently, my program compiles but doesn't link because of multiple definitions of _D4vibe7appmain12__ModuleInfoZ. I have no idea how they could appear. (The library that I'm trying to link against is libvibe-d.a found in my ~/.dub directory.)

Currently, -version=VibeCustomMain is required when building the vibe.d library to skip including the default main function of vibe.d (see source/vibe/appmain.d). This will be made the default later this year, after a deprecation phase.

dmd -lib -olibvibe-d.a -Isource -I<path/to/openssl> -I<path/to/libevent> -lssl -lcrypto -levent -levent_threads -version=VibeCustomMain -version=VibeLibeventDriver <all .d files of vibe.d>