digitalmars.D.ldc - Newbie question: how do I specify (at the command line) a library in
- WhatMeWorry (13/15) Aug 21 2019 So I've got a tiny program.
- David Nadlinger (4/5) Aug 21 2019 Typically, either supply the library file as a command line argument and...
- WhatMeWorry (13/19) Aug 22 2019 Sorry to be dense here, but shouldn't the command below work?
- kinke (3/6) Aug 23 2019 You probably specified an incompatible .lib (e.g., 32-bit lib for
So I've got a tiny program. C:\Users\me\klondike>ldc2 -c klondike The import of the library symbols are successful. The .obj file is created. Directory of C:\Users\me\klondike 08/13/2019 03:40 PM 803,328 test.lib 08/21/2019 06:17 PM 7,213 klondike.d 08/21/2019 06:39 PM 475,609 klondike.obj But when I try linking, I get errors. C:\Users\me\klondike>ldc2 klondike lld-link: error: undefined symbol: _D8colorize7winterm16WinTermEmulation10initializeMFNbNiZvIs there a way to specify my test.lib in the command?referenced by klondike.obj:(_D8colorize6cwrite__TQkTAyaZQrFS3std5stdio4FileQxZv)
Aug 21 2019
On 22 Aug 2019, at 0:55, WhatMeWorry via digitalmars-d-ldc wrote:Is there a way to specify my test.lib in the command?Typically, either supply the library file as a command line argument and let LDC handle it, or use the `-L` option to supply the appropriate flags directly to the linker. —David
Aug 21 2019
On Thursday, 22 August 2019 at 00:06:48 UTC, David Nadlinger wrote:On 22 Aug 2019, at 0:55, WhatMeWorry via digitalmars-d-ldc wrote:Sorry to be dense here, but shouldn't the command below work? 08/21/2019 06:17 PM 7,213 tiny.d 08/21/2019 12:23 PM 475,605 tiny.obj 08/19/2019 03:40 PM 803,328 test.lib C:\Users\me\tiny>ldc2 tiny.d test.lib lld-link: error: test.lib: unknown file type Error: linking with LLD failed How much clearer can this be? I've googled for the answer but I either get these huge dissertations on compiler/linkers or just a repeat of the ldc2 -helpIs there a way to specify my test.lib in the command?Typically, either supply the library file as a command line argument and let LDC handle it, or use the `-L` option to supply the appropriate flags directly to the linker. —David
Aug 22 2019
On Thursday, 22 August 2019 at 17:32:54 UTC, WhatMeWorry wrote:C:\Users\me\tiny>ldc2 tiny.d test.lib lld-link: error: test.lib: unknown file type Error: linking with LLD failedYou probably specified an incompatible .lib (e.g., 32-bit lib for 64-bit LDC target). The LLD error message is minimalistic.
Aug 23 2019