Thread overview
Exception with current version of dmd(2.066.1) and VisualD (v0.3.40)
Feb 04, 2015
Vincent R
Feb 04, 2015
Vincent R
Feb 04, 2015
Vincent R
Feb 04, 2015
Mike Parker
Feb 05, 2015
Vincent R
Feb 08, 2015
Rainer Schuetze
Feb 08, 2015
Rainer Schuetze
February 04, 2015
Hi,

I have been an enthusiatic supported of the D language a few years ago and I was curious to see the progress thta have been made and especially on the Windows platform and its integration with Visual Studio.
So I have installed the current stable version of dmd and Visual D on my Windows 8.1(x64) OS and I have created a new Windows application project.
When I start it through the debugger (in debug configuration) I get the following exception :

First-chance exception at 0x75A22F71 (KernelBase.dll) in WindowsApp1.exe: 0xE0440001 (parameters: 0x0041DB50).

What am I doing wrong ?

By the way we are in 2015 , so it would be cool to offer a password recovery for this forum and to explain what is the use of the email address because when we click on the question mark we can see this :


"When posting, you need to indicate an email address. It doesn't need to be a valid one; this software will not send anything to the specified address."

A bit weird...


February 04, 2015
it would be cool also to be able to edit a previous post
February 04, 2015
Building Debug\WindowsApp1.exe



Command Line


set PATH=C:\Developer\D\windows\\bin;C:\Program Files (x86)\Windows Kits\8.1\\\bin;%PATH%
dmd -g -debug -X -Xf"Debug\WindowsApp1.json" -deps="Debug\WindowsApp1.dep" -c -of"Debug\WindowsApp1.obj" winmain.d
if errorlevel 1 goto reportError

set LIB=
echo. > C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo "Debug\WindowsApp1.obj","Debug\WindowsApp1.exe_cv","Debug\WindowsApp1.map",ole32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo kernel32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo user32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo comctl32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo comdlg32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo user32.lib+ >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
echo kernel32.lib/NOMAP/CO/NOI/DELEXE /SUBSYSTEM:WINDOWS >> C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg

"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps Debug\WindowsApp1.lnkdep link.exe @C:\Users\Vincent\Documents\Projects\WindowsApp1\WindowsApp1\Debug\WindowsApp1.build.lnkarg
if errorlevel 1 goto reportError
if not exist "Debug\WindowsApp1.exe_cv" (echo "Debug\WindowsApp1.exe_cv" not created! && goto reportError)
echo Converting debug information...
"C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" "Debug\WindowsApp1.exe_cv" "Debug\WindowsApp1.exe"
if errorlevel 1 goto reportError
if not exist "Debug\WindowsApp1.exe" (echo "Debug\WindowsApp1.exe" not created! && goto reportError)

goto noError

:reportError
echo Building Debug\WindowsApp1.exe failed!

:noError

Output


winmain.d(18): Deprecation: function core.runtime.Runtime.initialize is deprecated - Please use the overload of Runtime.initialize that takes no argument.
winmain.d(22): Deprecation: function core.runtime.Runtime.terminate is deprecated - Please use the overload of Runtime.terminate that takes no argument.
Converting debug information...

February 04, 2015
On 2/5/2015 4:23 AM, Vincent R wrote:
> it would be cool also to be able to edit a previous post

The forum is a web frontend to a newsgroup.
February 05, 2015
On Wednesday, 4 February 2015 at 21:50:52 UTC, Mike Parker wrote:
> On 2/5/2015 4:23 AM, Vincent R wrote:
>> it would be cool also to be able to edit a previous post
>
> The forum is a web frontend to a newsgroup.

Ok thanks for the information.
I have found some threads about WinMain and main here:
http://forum.dlang.org/thread/mailman.199.1389129967.15871.digitalmars-d@puremagic.com

and I might try it but in this case why VisualD still uses deprecated sample code and propose to use WinMain ?
Why does it also use a deprecated method (Runtime.initialize(SomeArg))

IS is because I have installed a few month ago VisualD and it keeps some old template ?
if it's not the case would it be possible to fix it ?

The way of choosing between dmd and gdc also really sucks and is really not clear because inside the settings you can declare the two paths but you don't really know which compiler will be choosen. From what I understand you have to choose it from the beginning when you choose a project type...

Final remark why the compilation is done through a bat script instead of declaring a MSBuild VCToolTask ? I suppose that developping a VCToolTask is a bit more complicated but provides more control over the compiler.

Please have a look here to see how to do it:
https://code.google.com/p/vs-android/source/checkout

I have already developped a Visual Studio plugin to support a language called ObjectiveJ(from Cappuccino web framework) so if there is some need I might find some time to contribute.
February 08, 2015

On 04.02.2015 20:21, Vincent R wrote:
> Hi,
>
> I have been an enthusiatic supported of the D language a few years ago
> and I was curious to see the progress thta have been made and especially
> on the Windows platform and its integration with Visual Studio.
> So I have installed the current stable version of dmd and Visual D on my
> Windows 8.1(x64) OS and I have created a new Windows application project.
> When I start it through the debugger (in debug configuration) I get the
> following exception :
>
> First-chance exception at 0x75A22F71 (KernelBase.dll) in
> WindowsApp1.exe: 0xE0440001 (parameters: 0x0041DB50).
>
> What am I doing wrong ?

0xE0440001 is the code of D exceptions when being captured by as a Win32 exceptions.

The WindowsApp example actually shows throwing and capturing an exception, so there is nothing wrong. This has been copied from the dmd distribution some years ago, it should be updated to a newer version.

February 08, 2015

On 05.02.2015 21:49, Vincent R wrote:
> Final remark why the compilation is done through a bat script instead of
> declaring a MSBuild VCToolTask ? I suppose that developping a VCToolTask
> is a bit more complicated but provides more control over the compiler.

The beginning of Visual D predates VS 2010, the first version that added msbuild support for C++. Visual D rather mimicked how it was done before.

Adding build support through an msbuild DLL is probably possible, but I don't think it's easy to do in anything than C#. Maybe I'd be more relaxed about not using D for it now. ;-)

I don't think that msbuild gives you more control than a batch, it's just another API you have to follow and probably adds restrictions.
My experience with the msbuild integration of the Intel Compiler has been very bad (it got better with the very latest version from Intel), and I guess that's a sign that proper support isn't easy.