www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Getting Started With LDC troubles.

reply "Taylor Hillegeist" <taylorh140 gmail.com> writes:
So I was attempting to get the prebuilt binaries up and running 
for MSVC but ran into some trouble.

I did the following:

Installed LLVM from ClangOnWin version 3.7 something.

Downloaded ldc2-0.15.1-win64-msvc.zip Extracted contents to a 
folder on the c:\ drive added the bin folder to the path Tried to 
compile Helloworld.d with "ldc2 Helloworld.d"

Got "missing dll" error so

Installed MS C++ 2013 redistributable. Tried to compile 
Helloworld.d with "ldc2 Helloworld.d"

Noticed that it was "*d.dll" that was missing meaning debug

Installed MS Visual studio express 2013 Tried to compile 
Helloworld.d with "ldc2 Helloworld.d"

Got "cannot find link.exe"

Added "C:\Program Files\Microsoft Visual Studio 12.0\VC\bin" to 
the path

Got "LINK : fatal error LNK1181: cannot open input file 
'kernel32.lib'"

and now I have no idea what to do next? If there is a guide to 
get setup that would be nice to link here :)

So I found that this may be has to do with not having the Windows 
sdk installed.

I installed the windows sdk and added the C:\Program Files 
(x86)\Microsoft SDKs\Windows\v7.0A\Lib\ to the path ( it contains 
kernel32.lib )

I still get LINK : fatal error LNK1181: cannot open input file 
'kernel32.lib'

So then i open Ldc2.conf and added the line:

"-L-L/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64" 
Tried to compile Helloworld.d with "ldc2 Helloworld.d"

Got Cannot open LIBCMT.lib

Then i added

"-L-L/Program Files (x86)/Microsoft Visual Studio 
11.0/VC/lib/amd64"

Got a whole mess (37) of missing symbols from the math.obj

phobos2-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol trunc referenced in function _D3std4math4modfFNbNiNeeKeZe 
druntime-ldc.lib(math.obj) : error LNK2001: unresolved external 
symbol trunc phobos2-ldc.lib(math.obj) : error LNK2019: 
unresolved external symbol nearbyint referenced in function 
_D3std4math9nearbyintFNbNiNfeZe druntime-ldc.lib(math.obj) : 
error LNK2001: unresolved external symbol nearbyint 
phobos2-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol rint referenced in function _D3std4math4rintFNaNbNiNfeZe 
druntime-ldc.lib(math.obj) : error LNK2001: unresolved external 
symbol rint phobos2-ldc.lib(math.obj) : error LNK2019: unresolved 
external symbol round referenced in function 
_D3std4math5roundFNbNiNfeZe druntime-ldc.lib(math.obj) : error 
LNK2001: unresolved external symbol round 
phobos2-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol fma referenced in function _D3std4math3fmaFNaNbNiNfeeeZe 
druntime-ldc.lib(math.obj) : error LNK2001: unresolved external 
symbol fma druntime-ldc.lib(math.obj) : error LNK2019: unresolved 
external symbol _fdclass referenced in function 
_D4core4stdc4math10fpclassifyFNaNbNiNefZi 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol _dclass referenced in function 
_D4core4stdc4math10fpclassifyFNaNbNiNedZi 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol _fdsign referenced in function 
_D4core4stdc4math7signbitFNaNbNiNefZi druntime-ldc.lib(math.obj) 
: error LNK2019: unresolved external symbol _dsign referenced in 
function _D4core4stdc4math7signbitFNaNbNiNedZi 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol acosh referenced in function 
_D4core4stdc4math6acoshlFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol asinh referenced in 
function _D4core4stdc4math6asinhlFNaNbNiNeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol atanh referenced in function 
_D4core4stdc4math6atanhlFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol exp2 referenced in 
function _D4core4stdc4math5exp2lFNaNbNiNeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol expm1 referenced in function 
_D4core4stdc4math6expm1lFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol ilogb referenced in 
function _D4core4stdc4math6ilogblFNaNbNiNeeZi 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol log1p referenced in function 
_D4core4stdc4math6log1plFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol logb referenced in 
function _D4core4stdc4math5logblFNaNbNiNeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol scalbn referenced in function 
_D4core4stdc4math7scalbnlFNaNbNiNeeiZe druntime-ldc.lib(math.obj) 
: error LNK2019: unresolved external symbol scalbln referenced in 
function _D4core4stdc4math8scalblnlFNaNbNiNeeiZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol cbrt referenced in function 
_D4core4stdc4math5cbrtlFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol hypot referenced in 
function _D4core4stdc4math6hypotlFNaNbNiNeeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol erf referenced in function 
_D4core4stdc4math4erflFNaNbNiNeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol erfc referenced in 
function _D4core4stdc4math5erfclFNaNbNiNeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol lgamma referenced in function 
_D4core4stdc4math7lgammalFNaNbNiNeeZe druntime-ldc.lib(math.obj) 
: error LNK2019: unresolved external symbol tgamma referenced in 
function _D4core4stdc4math7tgammalFNaNbNiNeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol lrint referenced in function 
_D4core4stdc4math6lrintlFNaNbNiNeeZi druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol llrint referenced in 
function _D4core4stdc4math7llrintlFNaNbNiNeeZl 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol lround referenced in function 
_D4core4stdc4math7lroundlFNaNbNiNeeZi druntime-ldc.lib(math.obj) 
: error LNK2019: unresolved external symbol llround referenced in 
function _D4core4stdc4math8llroundlFNaNbNiNeeZl 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol remquo referenced in function 
_D4core4stdc4math7remquolFNaNbNiNeeePiZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol copysignreferenced in function 
_D4core4stdc4math9copysignlFNaNbNiNeeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol nan referenced in function 
_D4core4stdc4math4nanlFNaNbNiNePaZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol nextafter referenced in 
function _D4core4stdc4math10nextafterlFNaNbNiNeeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol nexttoward referenced in function 
_D4core4stdc4math11nexttowardlFNaNbNiNeeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol fdim referenced in function 
_D4core4stdc4math5fdimlFNaNbNiNeeeZe druntime-ldc.lib(math.obj) : 
error LNK2019: unresolved external symbol fmax referenced in 
function _D4core4stdc4math5fmaxlFNaNbNiNeeeZe 
druntime-ldc.lib(math.obj) : error LNK2019: unresolved external 
symbol fmin referenced in function 
_D4core4stdc4math5fminlFNaNbNiNeeeZe Helloworld.exe : fatal error 
LNK1120: 37 unresolved externals Error: C:\Program Files 
(x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe failed with 
status: 1120

Any Ideas?
Jan 24 2015
next sibling parent reply "Kagamin" <spam here.lot> writes:
You can try to open Visual studio Win64 command prompt (from 
start menu) and try to compile from there.
Jan 26 2015
parent reply "Taylor Hillegeist" <taylorh140 gmail.com> writes:
I was unable to find the "VS2013 x64 Native Tools Command Prompt" 
in my VS 2013 Express install. Only VS2013 x64 Cross, and it 
failed to compile with the same issues.

On Monday, 26 January 2015 at 14:44:03 UTC, Kagamin wrote:
 You can try to open Visual studio Win64 command prompt (from 
 start menu) and try to compile from there.
Jan 26 2015
next sibling parent "Kai Nacke" <kai redstar.de> writes:
On Tuesday, 27 January 2015 at 03:02:14 UTC, Taylor Hillegeist 
wrote:
 I was unable to find the "VS2013 x64 Native Tools Command 
 Prompt" in my VS 2013 Express install. Only VS2013 x64 Cross, 
 and it failed to compile with the same issues.

 On Monday, 26 January 2015 at 14:44:03 UTC, Kagamin wrote:
 You can try to open Visual studio Win64 command prompt (from 
 start menu) and try to compile from there.
Hi Taylor! I don't have the Express version so I can't give advice in this case. In general, if you are able to compile a C++ hello world application with cl on the command line then you should be able to do the same with ldc. ldc on Win64 is still bleeding edge - there are no install instructions yet. Regards, Kai
Jan 26 2015
prev sibling parent "Kagamin" <spam here.lot> writes:
On Tuesday, 27 January 2015 at 03:02:14 UTC, Taylor Hillegeist 
wrote:
 I was unable to find the "VS2013 x64 Native Tools Command 
 Prompt" in my VS 2013 Express install. Only VS2013 x64 Cross, 
 and it failed to compile with the same issues.
I don't have even that, lol. I guess, you can just run C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat - do you have the file? Or maybe your OS is 32-bit? In VS2012 the native tools command prompt link reads %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"" amd64
Jan 27 2015
prev sibling parent reply "Kagamin" <spam here.lot> writes:
On Saturday, 24 January 2015 at 20:28:55 UTC, Taylor Hillegeist 
wrote:
 Added "C:\Program Files\Microsoft Visual Studio 12.0\VC\bin" to 
 the path
You have such folder? It's not in Program Files (x86).
 Then i added

 "-L-L/Program Files (x86)/Microsoft Visual Studio 
 11.0/VC/lib/amd64"
That's not VC2013 folder.
Jan 27 2015
parent reply "Taylor Hillegeist" <taylorh140 gmail.com> writes:
On Tuesday, 27 January 2015 at 09:47:29 UTC, Kagamin wrote:
 On Saturday, 24 January 2015 at 20:28:55 UTC, Taylor Hillegeist 
 wrote:
 Added "C:\Program Files\Microsoft Visual Studio 12.0\VC\bin" 
 to the path
You have such folder? It's not in Program Files (x86).
 Then i added

 "-L-L/Program Files (x86)/Microsoft Visual Studio 
 11.0/VC/lib/amd64"
That's not VC2013 folder.
No, I Dont have A VS folder like that under my non-x86 files. Also I am running windows 8, which isn't fun. The Reason I added the 11.0 version was due to my 12.0 not containing the LIBCMTD.lib. I figure since the Compiler wanted a Kernel32.lib and a LIBCMTD.lib the Linker should probably be given a combination the following directories. C:\Program Files (x86)>dir LIBCMTD.lib /b/s C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\arm\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64\libcmtd.lib C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\ia64\libcmtd.lib C:\Program Files (x86)>dir Kernel32.lib /b/s C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\Kernel32.Lib C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\arm\kernel32.Lib C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x64\kernel32.Lib C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86\kernel32.Lib C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\arm\kernel32.Lib C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64\kernel32.Lib C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86\kernel32.Lib
Jan 27 2015
parent reply "Taylor Hillegeist" <taylorh140 gmail.com> writes:
So i figured out something really useful...

Visual Studio express for windows

has No win32 c++ componets!

however!

Visual Studio Express for windows Desktops does!

so don't get confused!
Jan 27 2015
parent reply "Taylor Hillegeist" <taylorh140 gmail.com> writes:
So That did the trick! Steps to take:

Install Visual Studio Express 2013 for windows Desktop
Get LDC2 MSVC
add LDC\Bin to the path
Under the Visual Studio Tools folder on the start menu open
VS2013 x64 Cross Tools Command Prompt
LDC2 HelloWorld.d

And bingo

I used
------------------------------HelloWorld.d
import std.stdio;
int main()
{
     writefln("Hello LDC2");
     return 0;
}
-------------------------------

Thanks Everybody!
Jan 27 2015
parent "Kai Nacke" <kai redstar.de> writes:
On Wednesday, 28 January 2015 at 04:56:33 UTC, Taylor Hillegeist 
wrote:
 So That did the trick! Steps to take:

 Install Visual Studio Express 2013 for windows Desktop
 Get LDC2 MSVC
 add LDC\Bin to the path
 Under the Visual Studio Tools folder on the start menu open
 VS2013 x64 Cross Tools Command Prompt
 LDC2 HelloWorld.d

 And bingo

 I used
 ------------------------------HelloWorld.d
 import std.stdio;
 int main()
 {
     writefln("Hello LDC2");
     return 0;
 }
 -------------------------------

 Thanks Everybody!
Hi Taylor! Thanks for the investigation and the wiki update! Regards, Kai
Jan 29 2015