RejectedSoftware Forums

Sign up

Include a small part without vibe.d's main

I'm interested in using vibe.d's json module in my project.

When I add vibe.d as a dependency in my project's package.json,
it obviously builds the entirety of vibe.d and it uses its own main.

I believe using "versions": ["VibeCustomMain"] should let me use it as I want.

I however get the following error:

Checking dependencies in 'C:\Test'
Copying files...
Building configuration "application", build type debug
Compiling...
Compiling..
Linking...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\main.exe.obj(main.exe)
 Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1
Error executing command run: Link command failed with exit code 1

What am I doing wrong? And is this the best method to get just the json module?

Re: Include a small part without vibe.d's main

Hrm, after some more testing it seems compilation fails when using both vibe.d and gfm.

package.json:

{
    "name": "project",
    "dependencies": {
		"vibe-d": { "version": "~master", },
		"gfm": { "version": "~master", },
    },	
}

An empty app.d:

module app;

This fails with a linker error

C:\Test
Checking dependencies in 'C:\Test'
Package gfm (configuration "library") defines no import paths, use {"importPaths": [...]} or the default package directory structure to fix this.
Copying files...
Building configuration "application", build type debug
Compiling...
Warning: -version=VibeDefaultMain will be required in the future to use vibe.d's default main(). Please update your build scripts.
Linking...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\project.obj(project)
 Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1
Error executing command run: Link command failed with exit code 1

Re: Include a small part without vibe.d's main

Am 30.12.2013 12:33, schrieb Lemonfiend:

Hrm, after some more testing it seems compilation fails when using both vibe.d and gfm.

package.json:

{
    "name": "project",
    "dependencies": {
		"vibe-d": { "version": "~master", },
		"gfm": { "version": "~master", },
    },	
}

An empty app.d:

module app;

This fails with a linker error

C:\Test
Checking dependencies in 'C:\Test'
Package gfm (configuration "library") defines no import paths, use {"importPaths": [...]} or the default package directory structure to fix this.
Copying files...
Building configuration "application", build type debug
Compiling...
Warning: -version=VibeDefaultMain will be required in the future to use vibe.d's default main(). Please update your build scripts.
Linking...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\project.obj(project)
 Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1
Error executing command run: Link command failed with exit code 1

It's a very annoying anachronism of the DMD Windows 32-bit version that
leads to this error. You could try to build the GIT master version of
DUB. It now supports building individual dependencies separately and
that might solve the issue.

Otherwise there is the unfortunate workaround to build with "dub
--build=plain" to disable debug information completely. Or, installing
VisualD and building 64-bit instead of 32-bit will solve the issue, as
it uses a different debug information format.

Re: Include a small part without vibe.d's main

Oh and apart from that it's planned to split up vibe.d into smaller
parts, which would probably also make it small enough, but the time for
that isn't clear, yet.

If you really just need the JSON functionality, as a temporary
workaround, you could also just rip out the module and put it into your
project, it has only a single dependency to other vibe.d modules
(vibe.data.serialization), so it's easy to separate.

Re: Include a small part without vibe.d's main

It's a very annoying anachronism of the DMD Windows 32-bit version that
leads to this error. You could try to build the GIT master version of
DUB. It now supports building individual dependencies separately and
that might solve the issue.

Tried it (with just gfm as dependency), but it doesn't work

C:\Test>dub
Checking dependencies in 'C:\Test'
Checking dependencies in 'C:\Test'
Generate target project (executable C:\Test project)
Generate target gfm (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm)
Generate target gfm:math (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_math)
Generate target gfm:net (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_net)
Generate target gfm:core (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_core)
Generate target gfm:assimp (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_assimp)
Generate target derelict-assimp3 (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\derelict-assimp3-master\lib De
relictASSIMP3)
Generate target derelict-util (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\derelict-util-1.0.0\lib DerelictU
til)
Generate target gfm:freeimage (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_freeimage)
Generate target derelict-fi (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\derelict-fi-master\lib DerelictFI)
Generate target gfm:image (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_image)
Generate target gfm:opengl (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_opengl)
Generate target derelict-gl3 (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\derelict-gl3-master\lib DerelictGL
3)
Generate target gfm:sdl2 (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\gfm-master gfm_sdl2)
Generate target derelict-sdl2 (staticLibrary C:\Users\user\AppData\Roaming\dub\packages\derelict-sdl2-master\lib Derelict
SDL2)
Building gfm:math configuration "library", build type debug.
Running dmd...
Building gfm:net configuration "library", build type debug.
Running dmd...
Building gfm:core configuration "library", build type debug.
Running dmd...
Building derelict-util configuration "library", build type debug.
Running dmd...
Building derelict-assimp3 configuration "library", build type debug.
Running dmd...
Building gfm:assimp configuration "library", build type debug.
Running dmd...
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception12__ModuleInfoZ and exception: _
D8derelict4util9exception12__ModuleInfoZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception7__arrayZ and exception: _D8dere
lict4util9exception7__arrayZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception8__assertFiZv and exception: _D8
derelict4util9exception8__assertFiZv
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception15__unittest_failFiZv and except
ion: _D8derelict4util9exception15__unittest_failFiZv
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception17DerelictException6__initZ and
exception: _D8derelict4util9exception17DerelictException6__initZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception17DerelictException7__ClassZ and
 exception: _D8derelict4util9exception17DerelictException7__ClassZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception17DerelictException6__vtblZ and
exception: _D8derelict4util9exception17DerelictException6__vtblZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception17DerelictException6__ctorMFAyaZ
C8derelict4util9exception17DerelictException and exception: _D8derelict4util9exception17DerelictException6__ctorMFAyaZC8
derelict4util9exception17DerelictException
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception15FailedSharedLib6__initZ and ex
ception: _D8derelict4util9exception15FailedSharedLib6__initZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception15FailedSharÚLib11__xopEqualsFKx
SÇ®║Ǽ¼Zb and exception: _D8derelict4util9exception15FailedSharÚLib11__xopEqualsFKxSÇ®║Ǽ¼Zb
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException6__initZ
 and exception: _D8derelict4util9exception22SharedLibLoadException6__initZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException7__Class
Z and exception: _D8derelict4util9exception22SharedLibLoadException7__ClassZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException6__vtblZ
 and exception: _D8derelict4util9exception22SharedLibLoadException6__vtblZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException8throwNe
wFxAAaxAAaZv and exception: _D8derelict4util9exception22SharedLibLoadException8throwNewFxAAaxAAaZv
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException6__ctorM
FAyaZC8derelict4util9exception22SharedLibLoadException and exception: _D8derelict4util9exception22SharedLibLoadException
6__ctorMFAyaZC8derelict4util9exception22SharedLibLoadException
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException6__ctorM
FAyaAyaZC8derelict4util9exception22SharedLibLoadException and exception: _D8derelict4util9exception22SharedLibLoadExcept
ion6__ctorMFAyaAyaZC8derelict4util9exception22SharedLibLoadException
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception22SharedLibLoadException13shared
LibNameMFZAya and exception: _D8derelict4util9exception22SharedLibLoadException13sharedLibNameMFZAya
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception19SymbolLoadException6__initZ an
d exception: _D8derelict4util9exception19SymbolLoadException6__initZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception19SymbolLoadException7__ClassZ a
nd exception: _D8derelict4util9exception19SymbolLoadException7__ClassZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception19SymbolLoadException6__vtblZ an
d exception: _D8derelict4util9exception19SymbolLoadException6__vtblZ
..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391BD8BD
7DD1\gfm_assimp.lib: Error: multiple definition of exception: _D8derelict4util9exception19SymbolLoadException6__ctorMFAy
aZC8derelict4util9exception19SymbolLoadException and exception: _D8derelict4util9exception19SymbolLoadException6__ctorMF
AyaZC8derelict4util9exception19SymbolLoadException
FAIL ..\..\..\Users\user\AppData\Roaming\dub\packages\gfm-master\.dub\build\library-debug-x86-dmd-87DF8F8E7188900AFFE1391
BD8BD7DD1 gfm_assimp staticLibrary
Error executing command run: DMD compile run failed with exit code 1

Otherwise there is the unfortunate workaround to build with "dub
--build=plain" to disable debug information completely. Or, installing
VisualD and building 64-bit instead of 32-bit will solve the issue, as
it uses a different debug information format.

The workaround works, thanks!

Re: Include a small part without vibe.d's main

Oh and apart from that it's planned to split up vibe.d into smaller
parts, which would probably also make it small enough, but the time for
that isn't clear, yet.

Very nice.

If you really just need the JSON functionality, as a temporary
workaround, you could also just rip out the module and put it into your
project, it has only a single dependency to other vibe.d modules
(vibe.data.serialization), so it's easy to separate.

That's indeed what I ended up doing :)

Re: Include a small part without vibe.d's main

Ah I think this might be related to: https://github.com/rejectedsoftware/dub/issues/199

Re: Include a small part without vibe.d's main

On Mon, 30 Dec 2013 12:53:29 +0100, Sönke Ludwig wrote:

Otherwise there is the unfortunate workaround to build with "dub
--build=plain" to disable debug information completely. Or, installing
VisualD and building 64-bit instead of 32-bit will solve the issue, as
it uses a different debug information format.

I have hit this issue now too just by trying to build with unittests:

e:\_docs\_bitbucket\stack4server\src\vibe\s4server>dub build --build=unittest
Checking dependencies in 'e:\_docs\_bitbucket\stack4server\src\vibe\s4server'
Copying files...
Building configuration "application", build type unittest
Compiling...
Linking...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-unittest-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\s4server.obj(s4server)
 Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1
Error executing command build: Link command failed with exit code 1

What kind of workaround do i have ?

Re: Include a small part without vibe.d's main

On Sun, 09 Feb 2014 23:22:01 GMT, Stephan Dilly wrote:

Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1

I also got this doing unittests but hadn't isolated it to vibe.d and I'm using the custom vibe main.

The only workaround for me was to write unittests in a separate package like the vibe.d examples, and to build a runtime debugger through LuaD. Would there be a fix for this?

Re: Include a small part without vibe.d's main

Am 10.02.2014 00:22, schrieb Stephan Dilly:

On Mon, 30 Dec 2013 12:53:29 +0100, Sönke Ludwig wrote:

Otherwise there is the unfortunate workaround to build with "dub
--build=plain" to disable debug information completely. Or, installing
VisualD and building 64-bit instead of 32-bit will solve the issue, as
it uses a different debug information format.

I have hit this issue now too just by trying to build with unittests:

e:\_docs\_bitbucket\stack4server\src\vibe\s4server>dub build --build=unittest
Checking dependencies in 'e:\_docs\_bitbucket\stack4server\src\vibe\s4server'
Copying files...
Building configuration "application", build type unittest
Compiling...
Linking...
OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-unittest-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709\s4server.obj(s4server)
  Error 45: Too Much DEBUG Data for Old CodeView format
--- errorlevel 1
Error executing command build: Link command failed with exit code 1

What kind of workaround do i have ?

Three possibilities come to mind:

  • dub build --build=unittest --arch=x86_64 to use the MS linker
  • set DFLAGS=-unittest && dub build --build=unittest to disable
    debug symbols for the unittest build
  • using Unilink instead of Optlink might also help, but that would
    need to be manually integrated into the build process