Am 09.12.2013 14:43, schrieb zhaopuming:

On Mon, 09 Dec 2013 11:11:35 GMT, Sönke Ludwig wrote:

Am 09.12.2013 11:38, schrieb zhaopuming:

Compiling...
source/app.d(3): Error: only one main allowed

So using ddb changes the project to a vibe.d project, but I only want to do a simple void main() experiment.

Sorry, this is still a left-over from the times when RDMD was used for building vibe.d projects. You can add a "versions": ["VibeCustomMain"] to your package.json file to fix this.

Thanks, this works!

I'll try to remove the need for this, but unfortunately it would break a lot of existing projects, including the examples on the vibe.d homepage, if just done directly. Ideally DUB should auto-detect this using dependency tracking, like RDMD. Until it does, the situation is a bit sub-optimal.

I'm fine with the aforementioned workaround. Maybe you could put it in the docs. Or even directly in the dub init generated main function.

The docs are now updated and a
transition phase from opt-out to opt-in has been started:

VibeDefaultMain should now be defined when the built-in main() is to
be used. Then, at some point, VibeCustomMain will be the default
behavior, so that vibe.d behaves like a normal library if
VibeDefaultMain isn't specified.

"dub init xxx vibe-d" (in the latest DUB beta) will now also put an
explicit VibeDefaultMain in the generated package.json.