On Tue, 18 Feb 2014 10:06:05 GMT, Sönke Ludwig wrote:

On Mon, 17 Feb 2014 18:02:02 GMT, Matthew Fong wrote:

I did a few more tests. Here are my findings:
dub does correctly set the -version=VibeWin32Driver flag for dmd and -m64, so that should be fine.
when it comes to the linking stage though, it still instructs the compiler to link in the non-existen libevent file.
So I wondered why that would be the case and indeed I found it also passes -version=VibeLibeventDriver to dmd. So somehow it must think I specified that too. (which I didn't - at least not in my local package.json).
Is there any other files that dub checks for for these version specifiers? Some files that I might have changed (I can't remember doing so, but I dont want to rule out the possibility)?
Here is my complete dub output on pastebin (since its too long otherwise):
http://pastebin.com/uiUU3BPd

I hope that helps diagnosing the problem

Oh sorry, I completely missed something. Selecting the driver must be done by choosing a different configuration instead of manually specifying a version constant:

{
	...
	"subConfigurations": {
		"vibe-d": "win32"
	},
	"versions": ["VibeDefaultMain"]
}

This will use the correct linker settings. Have a look at vibe.d's package.json to see how this is organized.

Ok, this almost fixes the problem.
After adding that section to my package.json, the output is as follows:

C:\test_flash\project>dub --arch=x86_64
Got application for true
Checking dependencies in 'C:\test_flash\project'
Copying files...
Building configuration "application", build type debug
Compiling...
source\autodata.d(46): Warning: toHash() must be declared as extern (D) size_t toHash() const nothrow @safe, not const ulong()
Linking...
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_TranslateMessage" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver15doProcessEventsMFkZb".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "PostMessageW" in Funktion "_D4vibe4core7drivers5win3216Win32ManualEvent4emitMFZv14__foreachbody2MFKC4vibe4core7dri
vers5win3216Win32EventDriverKbZi".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_RegisterClassA" in Funktion "_D4vibe4core7drivers5win3216setupWindowClassFZv".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_DefWindowProcA" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver9onMessageWNbPvkmlZl".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "PostThreadMessageW" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver13exitEventLoopMFZv".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "DispatchMessageW" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver15doProcessEventsMFkZb".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "SetWindowLongPtrA" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver6__ctorMFC4vibe4core6driver10DriverCor
eZC4vibe4core7drivers5win3216Win32EventDriver".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "GetWindowLongPtrA" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver6__ctorMFC4vibe4core6driver10DriverCor
eZC4vibe4core7drivers5win3216Win32EventDriver".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "PeekMessageW" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver15doProcessEventsMFkZb".
packetexport.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "MsgWaitForMultipleObjectsEx" in Funktion "_D4vibe4core7drivers5win3216Win32EventDriver13waitForEventsMFkZv".
phobos64.lib(windows_273_50d.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_CreateWindowExA" in Funktion "CreateWindowA".
.dub\build\application-debug-x86_64-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\packetexport.exe : fatal error LNK1120: 11 nicht aufgelöste Externe
--- errorlevel 1120
Error executing command run: Link command failed with exit code 1120

So I looked up these missing functions on MSDN and turns out they're all from User32.lib, so I simply added

"libs-windows": [
				...
				"user32"
			],

to dub's package.json. That made it compile+link+run correctly. I'm now a happy guy :)
Still, I wonder why this was necessary for me though. If this really is required, maybe it should be added by default.