digitalmars.D.learn - D static library on Windows 64 problem
- WhatMeWorry (24/24) Jan 02 2021 I'm stepping through the windows static library tutorial at
- WhatMeWorry (3/6) Jan 02 2021 Oops. used the manual example. Should be
- Imperatorn (3/11) Jan 03 2021 If it doesn't say so on the wiki (haven't read), could you update
- WhatMeWorry (4/16) Jan 03 2021 I'm sorry. The correction was for my first post, not the
I'm stepping through the windows static library tutorial at http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually ``` The fix is to specify the prebuilt .lib file on the command line: dmd driver.d %cd%\libs\libfoo\libfoo.lib ``` The tutorial is for 32 bit so it uses OPTLINK. I'm using 64 bits so it uses Microsoft's link.exe When I try dmd -m64 -v driver.d -L=/LIBPATH:"c:\dev\LibraryStudy\StaticLibrary\libfoobar" I get this monstrosity link.exe /NOLOGO "driver.obj" /DEFAULTLIB:phobos64 /LIBPATH:"c:\dev\LibraryStudy\StaticLibrary\libfoobar" /OPT:NOICF /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\lib\x64" legacy_stdio_definitions.lib /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" which I think would work except for the fact the path argument looses its double quotes. Is there a fix? I tried invoking link.exe directly with the ""s added manually, but then link.exe complains that phobos64.lib can't be found.
Jan 02 2021
On Saturday, 2 January 2021 at 22:04:28 UTC, WhatMeWorry wrote:I'm stepping through the windows static library tutorial at http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually [...]Oops. used the manual example. Should be /LIBPATH:c:\dev\LibraryStudy\StaticLibrary\libfoobar
Jan 02 2021
On Saturday, 2 January 2021 at 22:08:34 UTC, WhatMeWorry wrote:On Saturday, 2 January 2021 at 22:04:28 UTC, WhatMeWorry wrote:If it doesn't say so on the wiki (haven't read), could you update it with your findings? Thanks!I'm stepping through the windows static library tutorial at http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually [...]Oops. used the manual example. Should be /LIBPATH:c:\dev\LibraryStudy\StaticLibrary\libfoobar
Jan 03 2021
On Sunday, 3 January 2021 at 15:49:03 UTC, Imperatorn wrote:On Saturday, 2 January 2021 at 22:08:34 UTC, WhatMeWorry wrote:I'm sorry. The correction was for my first post, not the tutorial. If the tutorial was written for 64 bits I wouldn't be having this problem :)On Saturday, 2 January 2021 at 22:04:28 UTC, WhatMeWorry wrote:If it doesn't say so on the wiki (haven't read), could you update it with your findings? Thanks!I'm stepping through the windows static library tutorial at http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually [...]Oops. used the manual example. Should be /LIBPATH:c:\dev\LibraryStudy\StaticLibrary\libfoobar
Jan 03 2021