www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DUB - link error on Windows 10 64-bit

reply Dibyendu Majumdar <d.majumdar gmail.com> writes:
Hi

I am using DUB on Windows 10 64-bit with DMD. I have simple 
project with following configuration:

{
	"name": "testing",
	"description": "A minimal D application.",
	"copyright": "Copyright © 2016, dibyendu",
	"authors": ["dibyendu"],
	"targetType": "dynamicLibrary",
	"libs": ["somelib"],
	"lflags-windows-x86_64": ["/LIBPATH:c:\\lib\\"],
}

I get link errors such as:

error LNK2019: unresolved external symbol _d_assert
error LNK2019: unresolved external symbol _d_unittest
error LNK2001: unresolved external symbol _DllMainCRTStartup

I have installed DMD by unzipping the DMD archive (The installer 
does not work correctly on Windows 10). DUB installed as normal.

Would appreciate any tips on what I am doing wrong.

Thanks and Regards
Dibyendu
Jan 16 2016
next sibling parent reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
On 2016-01-16 20:28:02 +0000, Dibyendu Majumdar said:

 I have installed DMD by unzipping the DMD archive (The installer does 
 not work correctly on Windows 10). DUB installed as normal.
Check your paths in sc.ini Looks like the D link libraries are not found. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Jan 16 2016
parent reply Dibyendu Majumdar <d.majumdar gmail.com> writes:
On Saturday, 16 January 2016 at 20:50:51 UTC, Robert M. Münch 
wrote:
 Check your paths in sc.ini Looks like the D link libraries are 
 not found.
Well as far as I can tell they are correct (unchanged from whatever the installer set them to): ; environment for both 32/64 bit [Environment] DFLAGS="-I% P%\..\..\src\phobos" "-I% P%\..\..\src\druntime\import" ; optlink only reads from the Environment section so we need this redundancy ; from the Environment32 section (bugzilla 11302) LIB="% P%\..\lib" [Environment32] LIB="% P%\..\lib" LINKCMD=% P%\link.exe [Environment64] LIB="% P%\..\lib64"
Jan 16 2016
parent reply Mike Parker <aldacron gmail.com> writes:
On Saturday, 16 January 2016 at 21:51:15 UTC, Dibyendu Majumdar 
wrote:

 Well as far as I can tell they are correct (unchanged from 
 whatever the installer set them to):

 ; environment for both 32/64 bit
 [Environment]
 DFLAGS="-I% P%\..\..\src\phobos" 
 "-I% P%\..\..\src\druntime\import"

 ; optlink only reads from the Environment section so we need 
 this redundancy
 ; from the Environment32 section (bugzilla 11302)
 LIB="% P%\..\lib"


 [Environment32]
 LIB="% P%\..\lib"
 LINKCMD=% P%\link.exe


 [Environment64]
 LIB="% P%\..\lib64"
Have you verified that this is the only DMD installation on your path?
Jan 16 2016
parent Dibyendu Majumdar <d.majumdar gmail.com> writes:
On Sunday, 17 January 2016 at 03:07:39 UTC, Mike Parker wrote:

 Have you verified that this is the only DMD installation on 
 your path?
Looks like the problem is not in dub - but the fact that a shared library in D requires a DllMain - as described in: http://forum.dlang.org/post/eokrmosskwelrcyfkkdq forum.dlang.org So the DMD compiler is basically failing as I do not have a DllMain. Regards
Jan 17 2016
prev sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Saturday, 16 January 2016 at 20:28:02 UTC, Dibyendu Majumdar 
wrote:

 I have installed DMD by unzipping the DMD archive (The 
 installer does not work correctly on Windows 10). DUB installed 
 as normal.
What problem did you have with the installer? Which version? I've installed DMD more than once on Windows 10 and it worked flawlessly.
Jan 16 2016
next sibling parent Mike Parker <aldacron gmail.com> writes:
On Sunday, 17 January 2016 at 02:48:47 UTC, Mike Parker wrote:
 On Saturday, 16 January 2016 at 20:28:02 UTC, Dibyendu Majumdar 
 wrote:

 I have installed DMD by unzipping the DMD archive (The 
 installer does not work correctly on Windows 10). DUB 
 installed as normal.
What problem did you have with the installer? Which version? I've installed DMD more than once on Windows 10 and it worked flawlessly.
OK, nevermind. I've seen your other post.
Jan 16 2016
prev sibling parent bachmeier <no spam.net> writes:
On Sunday, 17 January 2016 at 02:48:47 UTC, Mike Parker wrote:
 On Saturday, 16 January 2016 at 20:28:02 UTC, Dibyendu Majumdar 
 wrote:

 I have installed DMD by unzipping the DMD archive (The 
 installer does not work correctly on Windows 10). DUB 
 installed as normal.
What problem did you have with the installer? Which version? I've installed DMD more than once on Windows 10 and it worked flawlessly.
I also installed on Windows 10 (a few days ago) and it worked. I could not get the installer to work, though, so I unzipped the archive like OP. Is it the case that Windows 10 is an uncommon target for DMD?
Jan 17 2016