Linking with a c library on windows with ldc

maik klein via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Fri Apr 1 08:14:32 PDT 2016


On Friday, 1 April 2016 at 14:48:17 UTC, maik klein wrote:
> On Friday, 1 April 2016 at 14:36:27 UTC, Johan Engelen wrote:
>> On Friday, 1 April 2016 at 14:26:23 UTC, maik klein wrote:
>>>
>>> I currently have Vs2015 installed
>>>
>>> Error: `C:\Windows\system32\cmd.exe /s /c 
>>> "C:\Users\maik\Downloads\ldc2-0.17.1-w
>>> in64-msvc\bin\amd64.bat lib.exe"` failed with status: 9009
>>> ldc2 failed with exit code 9009.
>>
>> This doesn't look like a linking error to me.
>> Can LDC create obj files? (use the "-c" cmdline option)
>>
>>>  I think only Vs2013 works with ldc?
>>
>> We encourage using VS2015.
>>
>> -Johan
>
> With Vs2015:
>
> I can output .obj files with c
>
> //test.d
> import std.stdio;
>
> void main(){
> 	writeln("test");
> }
>
> ldc2 test.d => same error as above
>
> ldc2 test.d -c works

Actually the build error is different if I don't use dub

ldc2 test.d
Using Visual Studio: C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\
WARNING: could not find VC\vcvarsall.bat
link: extra operand '/OPT:REF'
Try 'link --help' for more information.
Error: `C:\Windows\system32\cmd.exe /s /c 
"C:\Users\maik\Downloads\ldc2-0.17.1-w
in64-msvc\bin\amd64.bat link.exe"` failed with status: 1

So it seems that ldc just doesn't see vcvarsall.bat. I am just 
not sure where to get it, it doesn't seem to be bundled with 
visual studio 2015.




More information about the digitalmars-d-ldc mailing list