Jump to page: 1 2
Thread overview
How to use LLD linker?
Jun 30, 2018
Suliman
Jul 06, 2018
SrMordred
Jul 06, 2018
Suliman
Jul 06, 2018
Rainer Schuetze
Jul 06, 2018
SrMordred
Jul 06, 2018
0xEAB
Jul 06, 2018
0xEAB
Jul 06, 2018
SrMordred
Jul 06, 2018
SrMordred
Jul 06, 2018
SrMordred
Jul 07, 2018
0xEAB
June 30, 2018
Correct me if I am wrong, but I have read news that dmd now can be used without C++ Build Tools.

I trying to build simple project. And getting Error:

Warning: no Visual C++ installation detected
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 8: Illegal Filename
...

Error: C:\D\dmd2\windows\bin\link.exe failed with status: 1
ldc2 failed with exit code 1.

Same with dmd.

How to use LLD linker?
July 06, 2018
On Saturday, 30 June 2018 at 10:48:49 UTC, Suliman wrote:
> Correct me if I am wrong, but I have read news that dmd now can be used without C++ Build Tools.
>
> I trying to build simple project. And getting Error:
>
> Warning: no Visual C++ installation detected
> OPTLINK (R) for Win32  Release 8.00.17
> Copyright (C) Digital Mars 1989-2013  All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Error 8: Illegal Filename
> ...
>
> Error: C:\D\dmd2\windows\bin\link.exe failed with status: 1
> ldc2 failed with exit code 1.
>
> Same with dmd.
>
> How to use LLD linker?

Well I just installed the VS 2017 to try the ldc and get (maybe) the same error.

dub run --config=application --arch=x86_64 --build=debug --compiler=ldc2
Performing "debug" build using ldc2 for x86_64.
lib ~master: building configuration "application"...
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 8: Illegal Filename
/NOLOGO /DEBUG /OPT:REF /OPT:ICF /DEFAULTLIB:libcmt /DEFAULTLIB:libvcruntime "/OUT:.dub\build\application-debug-windows-x86_64-ldc_2081-FC0CCB721F0C7E0D58B93FB1E50E3401\lib.exe" ".dub\obj\lib.obj" "d:\ldc2\lib\ldc_rt.builtins.lib" /LIBPATH:d:/ldc2/bin/../lib phobos2-ldc.lib druntime-ldc.lib kernel32.lib user32.lib gdi32.lib
winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

                                                                              ^
Error: d:\D\dmd2\windows\bin\link.exe failed with status: 1
ldc2 failed with exit code 1.

July 06, 2018
> Well I just installed the VS 2017 to try the ldc and get (maybe) the same error.
>
> dub run --config=application --arch=x86_64 --build=debug --compiler=ldc2
> Performing "debug" build using ldc2 for x86_64.
> lib ~master: building configuration "application"...
> OPTLINK (R) for Win32  Release 8.00.17
> Copyright (C) Digital Mars 1989-2013  All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Error 8: Illegal Filename
> /NOLOGO /DEBUG /OPT:REF /OPT:ICF /DEFAULTLIB:libcmt /DEFAULTLIB:libvcruntime "/OUT:.dub\build\application-debug-windows-x86_64-ldc_2081-FC0CCB721F0C7E0D58B93FB1E50E3401\lib.exe" ".dub\obj\lib.obj" "d:\ldc2\lib\ldc_rt.builtins.lib" /LIBPATH:d:/ldc2/bin/../lib phobos2-ldc.lib druntime-ldc.lib kernel32.lib user32.lib gdi32.lib
> winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
>
> 
>             ^
> Error: d:\D\dmd2\windows\bin\link.exe failed with status: 1
> ldc2 failed with exit code 1.


Could you please try:
dub build --force

And write here if it's help
July 06, 2018

On 06/07/2018 05:48, SrMordred wrote:
> On Saturday, 30 June 2018 at 10:48:49 UTC, Suliman wrote:
>> Correct me if I am wrong, but I have read news that dmd now can be used without C++ Build Tools.
>>
>> I trying to build simple project. And getting Error:
>>
>> Warning: no Visual C++ installation detected
>> OPTLINK (R) for Win32  Release 8.00.17
>> Copyright (C) Digital Mars 1989-2013  All rights reserved.
>> http://www.digitalmars.com/ctg/optlink.html
>> OPTLINK : Error 8: Illegal Filename
>> ...
>>
>> Error: C:\D\dmd2\windows\bin\link.exe failed with status: 1
>> ldc2 failed with exit code 1.
>>
>> Same with dmd.
>>
>> How to use LLD linker?
> 
> Well I just installed the VS 2017 to try the ldc and get (maybe) the same error.
> 
> dub run --config=application --arch=x86_64 --build=debug --compiler=ldc2
> Performing "debug" build using ldc2 for x86_64.
> lib ~master: building configuration "application"...
> OPTLINK (R) for Win32  Release 8.00.17
> Copyright (C) Digital Mars 1989-2013  All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> OPTLINK : Error 8: Illegal Filename
> /NOLOGO /DEBUG /OPT:REF /OPT:ICF /DEFAULTLIB:libcmt /DEFAULTLIB:libvcruntime "/OUT:.dub\build\application-debug-windows-x86_64-ldc_2081-FC0CCB721F0C7E0D58B93FB1E50E3401\lib.exe" ".dub\obj\lib.obj" "d:\ldc2\lib\ldc_rt.builtins.lib" /LIBPATH:d:/ldc2/bin/../lib phobos2-ldc.lib druntime-ldc.lib kernel32.lib user32.lib gdi32.lib
> winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
> 
>              ^
> Error: d:\D\dmd2\windows\bin\link.exe failed with status: 1
> ldc2 failed with exit code 1.
> 

The problem is that the Digital Mars linker is called but the Microsoft linker is run, because they share the same name link.exe. For dmd/x64/32mscoff or LDC in general the latter is expected to be used. Usually dmd and ldc know how to find the appropriate one, but dub might just expect it to be found through the PATH environment variable.

So, try to set your PATH so that the MS linker is found first.
July 06, 2018
On Friday, 6 July 2018 at 10:55:47 UTC, Rainer Schuetze wrote:
>
>
> On 06/07/2018 05:48, SrMordred wrote:
>> [...]
>
> The problem is that the Digital Mars linker is called but the Microsoft linker is run, because they share the same name link.exe. For dmd/x64/32mscoff or LDC in general the latter is expected to be used. Usually dmd and ldc know how to find the appropriate one, but dub might just expect it to be found through the PATH environment variable.
>
> So, try to set your PATH so that the MS linker is found first.

Yep, this is the way, but i could make it work yet. The PATH works, but i get errors relate to libs, even running vcvarsall.bat. Thats bizarre since its a fresh intallation of VS. It used to work, not sure what happened. Anyway i'll give up by now and try another time.

I thought that LDC removed this VS dependecy.
July 06, 2018
On Friday, 6 July 2018 at 17:32:09 UTC, SrMordred wrote:
> On Friday, 6 July 2018 at 10:55:47 UTC, Rainer Schuetze wrote:
>>
>>
>> On 06/07/2018 05:48, SrMordred wrote:
>>> [...]
>>
>> The problem is that the Digital Mars linker is called but the Microsoft linker is run, because they share the same name link.exe. For dmd/x64/32mscoff or LDC in general the latter is expected to be used. Usually dmd and ldc know how to find the appropriate one, but dub might just expect it to be found through the PATH environment variable.
>>
>> So, try to set your PATH so that the MS linker is found first.
>
> Yep, this is the way, but i could make it work yet. The PATH works, but i get errors relate to libs, even running vcvarsall.bat. Thats bizarre since its a fresh intallation of VS. It used to work, not sure what happened. Anyway i'll give up by now and try another time.
>
> I thought that LDC removed this VS dependecy.

The latest stable release didn't, at least.

Which means, if it cannot locate the Windows SDK, it will call `link.exe` and hope to execute something useful, which - as already stated before - isn't the case and usually leads to OptLink.
July 06, 2018
On Friday, 6 July 2018 at 03:48:04 UTC, SrMordred wrote:
> Well I just installed the VS 2017 to try the ldc and get (maybe) the same error.

You didn't forget to install the Windows SDK with it, did you?

July 06, 2018
On Friday, 6 July 2018 at 19:36:05 UTC, 0xEAB wrote:
> On Friday, 6 July 2018 at 03:48:04 UTC, SrMordred wrote:
>> Well I just installed the VS 2017 to try the ldc and get (maybe) the same error.
>
> You didn't forget to install the Windows SDK with it, did you?

Yep I forgot xD
It fixed the PATHs but still getting this:

libcmt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

which i´m trying to solve now.


July 06, 2018
Delete everything, installed everything again, the installation failed to set the proper PATH to MS link.exe, so i put it by hand and now get:
fatal error LNK1104: cannot open file 'libcmt.lib'

Frustrating.
July 06, 2018
Well, since its VS 2017 installer, eventually I hit all the components needed to install it properly. Now its working.
Thanks 0xEAB for the tip about the Windows SDK too :)

« First   ‹ Prev
1 2