[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 --- Comment #9 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f9e92a011953bf4fef0e4ef34e898ba14796b93d fix issue 15482 - new uuid.d forbids to link statically with other libraries remove "export extern (C)" from IIDs to not conflict with uuid.lib from the platform SDK https://github.com/dlang/druntime/commit/f2f3f240267376b53f5c72a5a8141139086a3390 Merge pull request #2063 from rainers/issue15482 fix issue 15482 - new uuid.d forbids to link statically with other libs --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 github-bugzi...@puremagic.com changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 Vladimir Panteleevchanged: What|Removed |Added CC||dlang-bugzilla@thecybershad ||ow.net --- Comment #8 from Vladimir Panteleev --- Why not just remove the export or extern(C) annotations in core.sys.windows.uuid? --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 --- Comment #7 from Temtaime--- Yes, do it --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 --- Comment #6 from Manu--- Okay... so, extern to them and remove the definitions in druntime? --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 --- Comment #5 from Martin Nowak--- (In reply to Manu from comment #4) It's probably just a mistake from adding the Windows headers. --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 Manu <turkey...@gmail.com> changed: What|Removed |Added CC||turkey...@gmail.com --- Comment #4 from Manu <turkey...@gmail.com> --- Turns out the symbols are in druntime (I also couldn't find them in phobos!). druntime also has a uuid.d file, so the same object filename, and the symbols are in there. It seems that druntime and phobos are aggregated into one lib? Weird, but okay... Anyway... I'm not entirely sure these symbols should be in druntime. Why are they there? Why can't users just link the usual libs that supple them? Those libs are now mutually exclusive with phobos, and that's a big problem. --
Re: uuid.d
On Wednesday, 5 October 2016 at 11:00:19 UTC, Temtaime wrote: Please, remove that ugly module. You don't want to remove it, then you'd just get symbol undefined errors when you use them! The Microsoft headers defined them as extern, ours defined them as regular variables. That's the difference causing the problem. The bug report says the gnu toolchain can't handle the externs but since we use the Microsoft one, we should probably do it their way.
Re: uuid.d
On Wednesday, 5 October 2016 at 10:37:20 UTC, Walter Bright wrote: On 10/5/2016 12:56 AM, Manu via Digitalmars-d wrote: I do wonder why these uuid's should be in druntime though? The suite present is far from complete, and there are already libs in the windows ecosystem that have these symbols, so is it really useful to define them in druntime? I don't know, I didn't write that module. Please, remove that ugly module. As was said there's already necessary libraries on windows with needed uuids.
Re: uuid.d
On 10/5/2016 12:56 AM, Manu via Digitalmars-d wrote: I do wonder why these uuid's should be in druntime though? The suite present is far from complete, and there are already libs in the windows ecosystem that have these symbols, so is it really useful to define them in druntime? I don't know, I didn't write that module.
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 anonymous4changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|WORKSFORME |--- --- Comment #3 from anonymous4 --- Another case: https://forum.dlang.org/post/mailman.892.1475632667.2994.digitalmar...@puremagic.com --
Re: uuid.d
https://issues.dlang.org/show_bug.cgi?id=15482 this?
Re: uuid.d
On 5 October 2016 at 17:27, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > You can find out what symbols are defined where in a library by using the > lib program: > > lib -l phobos64.lib > > http://www.digitalmars.com/ctg/lib.html It was also written in the error: error LNK2005: IID_IDirectSoundNotify already defined in phobos64.lib(uuid.obj) Ie, uuid.obj, so I looked in phobos uuid.d and saw nothing. Turns out there's another uuid.d in druntime too, and druntime+phobos are aggregated into phobos64.lib... I wouldn't have expected that. It's all good. I do wonder why these uuid's should be in druntime though? The suite present is far from complete, and there are already libs in the windows ecosystem that have these symbols, so is it really useful to define them in druntime?
Re: uuid.d
You can find out what symbols are defined where in a library by using the lib program: lib -l phobos64.lib http://www.digitalmars.com/ctg/lib.html
Re: uuid.d
On Wednesday, 5 October 2016 at 02:34:52 UTC, Manu wrote: Sure, I can always work-around problems locally. Eh, I tend to stop at "works for me" so I can't do much else. They'd prolly accept a PR adding the other guids to the druntime file though without real hassle, though I wonder if they should actually be listed there as they are now, or if they should be redefined to be `extern` so it always loads the actual symbol off the system dll. I imagine extern is the way to go... but I don't know why they didn't do it that way originally. Are all those guids in the system libs?
Re: uuid.d
On Wednesday, 5 October 2016 at 02:35:27 UTC, Manu wrote: So, phobos64.lib includes druntime? They're not built separately? They are built separately, but bundled together at the last step for distribution.
Re: uuid.d
On 5 October 2016 at 12:12, Adam D. Ruppe via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > On Wednesday, 5 October 2016 at 01:57:35 UTC, Manu wrote: >> >> it's saying they're already defined in phobos64.lib... wtf? >> I checked std/uuid.d and there's nothing of the sort defined in >> there... > > > They are in the druntime src, core.sys.windows.uuid > > https://github.com/dlang/druntime/blob/master/src/core/sys/windows/uuid.d So, phobos64.lib includes druntime? They're not built separately?
Re: uuid.d
On 5 October 2016 at 12:12, Adam D. Ruppe via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > On Wednesday, 5 October 2016 at 01:57:35 UTC, Manu wrote: >> >> it's saying they're already defined in phobos64.lib... wtf? >> I checked std/uuid.d and there's nothing of the sort defined in >> there... > > > They are in the druntime src, core.sys.windows.uuid > > https://github.com/dlang/druntime/blob/master/src/core/sys/windows/uuid.d > >> So, dxguid.lib appears to be mutually exclusive with phobos64.lib, except >> that phobox64.lib is incomplete... I can't link. > > > I'm not sure what the best solution is, but one you could do is just take > the missing ones and define them in your own file, then link with phobos but > not with dxguid. Sure, I can always work-around problems locally. But my point is, it's not okay how it is.
Re: uuid.d
On Wednesday, 5 October 2016 at 01:57:35 UTC, Manu wrote: it's saying they're already defined in phobos64.lib... wtf? I checked std/uuid.d and there's nothing of the sort defined in there... They are in the druntime src, core.sys.windows.uuid https://github.com/dlang/druntime/blob/master/src/core/sys/windows/uuid.d So, dxguid.lib appears to be mutually exclusive with phobos64.lib, except that phobox64.lib is incomplete... I can't link. I'm not sure what the best solution is, but one you could do is just take the missing ones and define them in your own file, then link with phobos but not with dxguid.
uuid.d
I have this weird link error going on: 1>dxguid.lib(dxguid.obj) : error LNK2005: IID_IDirectSoundCapture already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: IID_IDirectSoundCaptureBuffer already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: DPLPROPERTY_MessagesSupported already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: DPLPROPERTY_LobbyGuid already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: DPLPROPERTY_PlayerGuid already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: DPLPROPERTY_PlayerScore already defined in phobos64.lib(uuid.obj) 1>dxguid.lib(dxguid.obj) : error LNK2005: IID_IDirectSoundNotify already defined in phobos64.lib(uuid.obj) etc, for pages and pages... I expect to find these symbols in dxguid.lib, so I link the lib, and it's saying they're already defined in phobos64.lib... wtf? I checked std/uuid.d and there's nothing of the sort defined in there... I can't find any mention of these symbols anywhere in the phobos source. Can any phobos dev's suggest how this mountain of guid symbols might find its way into phobos? I figured "okay, I guess I don't need to link dxguid.lib", so I didn't, and it did resolve 99% of the symbols... except I have 4 left: 2>error LNK2001: unresolved external symbol IID_IDirectInput8W 2>error LNK2001: unresolved external symbol IID_IDirectSoundBuffer8 2>error LNK2001: unresolved external symbol WKPDID_D3DDebugObjectName 2>error LNK2001: unresolved external symbol WKPDID_D3DDebugObjectName So, dxguid.lib appears to be mutually exclusive with phobos64.lib, except that phobox64.lib is incomplete... I can't link.
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 --- Comment #2 from Sobirari Muhomori <dfj1es...@sneakemail.com> --- There's a little incompatibility here: mssdk provides these guids in a static library and declares them as extern in headers, but gnu toolchain can't handle this scenario gracefully and would link all guids into executable, hence mingw headers declare guids as static (hidden in C) and doesn't provide static library with them. To use mssdk library and declare guids as extern, write extern extern(C) immutable IID GUID_Button; (without initializer) instead of what currently is in uuid.d --
[Issue 15482] new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 Martin Nowakchanged: What|Removed |Added Status|NEW |RESOLVED CC||c...@dawg.eu Resolution|--- |WORKSFORME --- Comment #1 from Martin Nowak --- I couldn't find any of those symbols in the phobos64.lib from 2.070.0-b1 [¹] or the latest nightly [²]. The name phobos_x64.lib suggests that you've compiled the library yourself. Please provide more details if your problem persists. [¹]: http://downloads.dlang.org/pre-releases/2.x/2.070.0/dmd.2.070.0-b1.windows.7z [²]: https://builds.dawg.eu/dmd-2016-01-10/dmd.master.windows.7z --
[Issue 15482] New: new uuid.d forbids to link statically with other libraries
https://issues.dlang.org/show_bug.cgi?id=15482 Issue ID: 15482 Summary: new uuid.d forbids to link statically with other libraries Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: regression Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: temta...@gmail.com phobos_x64.lib(uuid.obj) : error LNK2005: CLSID_DirectInput already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: CLSID_DirectInputDevice already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_Button already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_ConstantForce already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_CustomForce already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_Damper already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_1394 already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_1394DEBUG already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_61883 already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_ADAPTER already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_APMSUPPORT already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_AVC already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_BATTERY already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_BLUETOOTH already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_CDROM already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_COMPUTER already defined in sdl_x64.lib(SDL_dxjoystick.obj) phobos_x64.lib(uuid.obj) : error LNK2005: GUID_DEVCLASS_DECODER already defined in sdl_x64.lib(SDL_dxjoystick.obj) And so on. Why we ever export uuids from uuid.d ? --