www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Using MSDEV to *compile* AND *debug* D programs.

reply Regan Heath <regan netwin.co.nz> writes:
Hi,

I have managed to get MSDEV to compile and debug my D programs (thanks to 
Arcane Jill for the idea)

Here is what I did:

1. create an MSDEV "Utility" project - these are like normal projects but 
they do not do the link step.

2. add your .d source files to this project. (all of them).

3. edit project settings, expand list on left, for each source file define 
the following "Custom Build" settings:

[Commands]
D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c -od"$(IntDir)"

[Output]
$(IntDir)\$(InputName).obj

[as this is the same for all source files, it'd be great if I could define 
it for all somewhere instead of having to define it for each and every 
file]

4. edit project settings, click project name at top of tree on left, in 
the post-build section add the command

d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

and that's it. Hit compile and it should create a Debug/Release dir with 
the .obj and .exe file in it. Put a breakpoint in and press Run and you're 
debugging (assuming you're in debug mode)

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 23 2004
next sibling parent reply Billy Zelsnack <billy_zelsnack yahoo.com> writes:
I make a utility project also, but I just add a custom tool bound to F8 
that calls make.exe in the right directory. This way I just need to add 
the file to the workspace and the makefile.

My makefile is also simplified. I found that compiling was significantly 
faster if I just put everything on the same command line and called 
dmd.exe once. This makes sense because the compiler doesn't have to 
constantly do the same work over and over again. Right now my project 
takes about 0 seconds to compile and that rocks. The only problem with 
this method is sometimes the compiler errors are not much help because 
they don't tell you what file a problem occurred in.

Personally I think that the old school 'compile a single file at a time' 
concept is outdated. If your compiler is fast enough, then why not 
compile the entire project every time. This becomes more true in the 
future as projects size grow slowly while computer speed just gets 
crazy. This is not plausible in c++ right now (or for quite awhile), but 
it definitely is in D.


Regan Heath wrote:
 Hi,
 
 I have managed to get MSDEV to compile and debug my D programs (thanks 
 to Arcane Jill for the idea)
 
 Here is what I did:
 
 1. create an MSDEV "Utility" project - these are like normal projects 
 but they do not do the link step.
 
 2. add your .d source files to this project. (all of them).
 
 3. edit project settings, expand list on left, for each source file 
 define the following "Custom Build" settings:
 
 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c -od"$(IntDir)"
 
 [Output]
 $(IntDir)\$(InputName).obj
 
 [as this is the same for all source files, it'd be great if I could 
 define it for all somewhere instead of having to define it for each and 
 every file]
 
 4. edit project settings, click project name at top of tree on left, in 
 the post-build section add the command
 
 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"
 
 and that's it. Hit compile and it should create a Debug/Release dir with 
 the .obj and .exe file in it. Put a breakpoint in and press Run and 
 you're debugging (assuming you're in debug mode)
 

May 24 2004
parent reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
Wholeheartedly agreed;

Mango.* has ~75 files/800KB. All are compiled together as you describe,
which takes about 1.5 seconds, debug-mode, on an old P3-866. That's one of
the great things about D -- the compiler is so eff'ing fast ...

- Kris


"Billy Zelsnack" <billy_zelsnack yahoo.com> wrote in message
news:c8sv9r$2edh$1 digitaldaemon.com...
 I make a utility project also, but I just add a custom tool bound to F8
 that calls make.exe in the right directory. This way I just need to add
 the file to the workspace and the makefile.

 My makefile is also simplified. I found that compiling was significantly
 faster if I just put everything on the same command line and called
 dmd.exe once. This makes sense because the compiler doesn't have to
 constantly do the same work over and over again. Right now my project
 takes about 0 seconds to compile and that rocks. The only problem with
 this method is sometimes the compiler errors are not much help because
 they don't tell you what file a problem occurred in.

 Personally I think that the old school 'compile a single file at a time'
 concept is outdated. If your compiler is fast enough, then why not
 compile the entire project every time. This becomes more true in the
 future as projects size grow slowly while computer speed just gets
 crazy. This is not plausible in c++ right now (or for quite awhile), but
 it definitely is in D.

May 24 2004
parent reply Regan Heath <regan netwin.co.nz> writes:
Despite the speed it is still in-eficient to recompile everything all the 
time.
If the object file is up to date, why compile it again?

But hey, who cares, do it whatever way you like I say. :)

On Mon, 24 May 2004 08:21:38 -0700, Kris 
<someidiot earthlink.dot.dot.dot.net> wrote:

 Wholeheartedly agreed;

 Mango.* has ~75 files/800KB. All are compiled together as you describe,
 which takes about 1.5 seconds, debug-mode, on an old P3-866. That's one 
 of
 the great things about D -- the compiler is so eff'ing fast ...

 - Kris


 "Billy Zelsnack" <billy_zelsnack yahoo.com> wrote in message
 news:c8sv9r$2edh$1 digitaldaemon.com...
 I make a utility project also, but I just add a custom tool bound to F8
 that calls make.exe in the right directory. This way I just need to add
 the file to the workspace and the makefile.

 My makefile is also simplified. I found that compiling was significantly
 faster if I just put everything on the same command line and called
 dmd.exe once. This makes sense because the compiler doesn't have to
 constantly do the same work over and over again. Right now my project
 takes about 0 seconds to compile and that rocks. The only problem with
 this method is sometimes the compiler errors are not much help because
 they don't tell you what file a problem occurred in.

 Personally I think that the old school 'compile a single file at a time'
 concept is outdated. If your compiler is fast enough, then why not
 compile the entire project every time. This becomes more true in the
 future as projects size grow slowly while computer speed just gets
 crazy. This is not plausible in c++ right now (or for quite awhile), but
 it definitely is in D.


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 24 2004
next sibling parent reply Andy Friesen <andy ikagames.com> writes:
Regan Heath wrote:
 Despite the speed it is still in-eficient to recompile everything all 
 the time.
 If the object file is up to date, why compile it again?

The Mozilla people would agree with you. (it's my understanding that the Mozilla source is bigger than the Windows NT source) I compile one at a time because that's how SCons works by default. I'm sure it could be adjusted, but that would take precious effort that could be spent elsewhere. :) -- andy
May 24 2004
parent reply Stephen Waits <steve waits.net> writes:
Andy Friesen wrote:
 I compile one at a time because that's how SCons works by default.  I'm 

Ahh SCons :) Does SCons know about D (dmd or dfront) by default now? Thanks, Steve
May 25 2004
parent Andy Friesen <andy ikagames.com> writes:
Stephen Waits wrote:

 Andy Friesen wrote:
 
 I compile one at a time because that's how SCons works by default.  I'm 

Ahh SCons :) Does SCons know about D (dmd or dfront) by default now?

Yessir. As of version 0.95, it's standard fare. http://www.scons.org/ -- andy
May 25 2004
prev sibling parent Billy Zelsnack <billy_zelsnack yahoo.com> writes:
I like it because it is just one less thing to worry about. I have been 
bitten many times by not having objects up to date and chasing around 
false bugs that disappeared on a full build.


Regan Heath wrote:
 Despite the speed it is still in-eficient to recompile everything all 
 the time.
 If the object file is up to date, why compile it again?
 
 But hey, who cares, do it whatever way you like I say. :)

May 24 2004
prev sibling parent reply "davepermen" <davepermen hotmail.com> writes:
possibly we can simply replace the c++ compiler of vc6 with dmd, and get it
to work again then? with the right compiler flags.. needs some hacking,
possibly even of the exe (to change the default flags), but that doesn't
mather. i can co-install vc6 and vc.net 2003, and don't need vc6 for c++ at
all anyways.. so it could get abused instead:D

then again, i'm simply waiting to get leds on windows....
one day..

one day....

till then, i continue with c++, writing platform independent web, and mail
servers for my fancy homepage, all with sdl and sdl_net and freeimage (yeah,
i'm coming from gamedev, and i stay there:D)

"Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
news:opr8hezx1z5a2sq9 digitalmars.com...
 Hi,

 I have managed to get MSDEV to compile and debug my D programs (thanks to
 Arcane Jill for the idea)

 Here is what I did:

 1. create an MSDEV "Utility" project - these are like normal projects but
 they do not do the link step.

 2. add your .d source files to this project. (all of them).

 3. edit project settings, expand list on left, for each source file define
 the following "Custom Build" settings:

 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c -od"$(IntDir)"

 [Output]
 $(IntDir)\$(InputName).obj

 [as this is the same for all source files, it'd be great if I could define
 it for all somewhere instead of having to define it for each and every
 file]

 4. edit project settings, click project name at top of tree on left, in
 the post-build section add the command

 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

 and that's it. Hit compile and it should create a Debug/Release dir with
 the .obj and .exe file in it. Put a breakpoint in and press Run and you're
 debugging (assuming you're in debug mode)

 -- 
 Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

May 25 2004
parent reply Regan Heath <regan netwin.co.nz> writes:
On Tue, 25 May 2004 23:23:42 +0200, davepermen <davepermen hotmail.com> 
wrote:
 possibly we can simply replace the c++ compiler of vc6 with dmd, and get 
 it to work again then? with the right compiler flags.. needs some 
 hacking,
 possibly even of the exe (to change the default flags), but that doesn't
 mather. i can co-install vc6 and vc.net 2003, and don't need vc6 for 
 c++ at all anyways.. so it could get abused instead:D

Let me know how you get on.
 then again, i'm simply waiting to get leds on windows....
 one day..
 one day....

Have you tried DIDE? http://www.atari-soldiers.com/dide.html
 till then, i continue with c++, writing platform independent web, and 
 mail servers for my fancy homepage, all with sdl and sdl_net and 
 freeimage (yeah, i'm coming from gamedev, and i stay there:D)

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8hezx1z5a2sq9 digitalmars.com...
 Hi,

 I have managed to get MSDEV to compile and debug my D programs (thanks 
 to
 Arcane Jill for the idea)

 Here is what I did:

 1. create an MSDEV "Utility" project - these are like normal projects 
 but
 they do not do the link step.

 2. add your .d source files to this project. (all of them).

 3. edit project settings, expand list on left, for each source file 
 define
 the following "Custom Build" settings:

 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c -od"$(IntDir)"

 [Output]
 $(IntDir)\$(InputName).obj

 [as this is the same for all source files, it'd be great if I could 
 define
 it for all somewhere instead of having to define it for each and every
 file]

 4. edit project settings, click project name at top of tree on left, in
 the post-build section add the command

 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

 and that's it. Hit compile and it should create a Debug/Release dir with
 the .obj and .exe file in it. Put a breakpoint in and press Run and 
 you're
 debugging (assuming you're in debug mode)

 --
 Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 25 2004
parent reply "davepermen" <davepermen hotmail.com> writes:
yep, i dislike it very much, sorry. (the work is great, but its loaded with
user-interface-bugs and misbehaviours, and, together with a virescanne,
offlinefolders, and network-shares, it gets huge problems, and always fucks
its configuration..)

i prefer an open cmdline and a good texteditor, instead..

thats why i hope for leds..

"Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
news:opr8ksjzu35a2sq9 digitalmars.com...
 On Tue, 25 May 2004 23:23:42 +0200, davepermen <davepermen hotmail.com>
 wrote:
 possibly we can simply replace the c++ compiler of vc6 with dmd, and get
 it to work again then? with the right compiler flags.. needs some
 hacking,
 possibly even of the exe (to change the default flags), but that doesn't
 mather. i can co-install vc6 and vc.net 2003, and don't need vc6 for
 c++ at all anyways.. so it could get abused instead:D

Let me know how you get on.
 then again, i'm simply waiting to get leds on windows....
 one day..
 one day....

Have you tried DIDE? http://www.atari-soldiers.com/dide.html
 till then, i continue with c++, writing platform independent web, and
 mail servers for my fancy homepage, all with sdl and sdl_net and
 freeimage (yeah, i'm coming from gamedev, and i stay there:D)

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8hezx1z5a2sq9 digitalmars.com...
 Hi,

 I have managed to get MSDEV to compile and debug my D programs (thanks
 to
 Arcane Jill for the idea)

 Here is what I did:

 1. create an MSDEV "Utility" project - these are like normal projects
 but
 they do not do the link step.

 2. add your .d source files to this project. (all of them).

 3. edit project settings, expand list on left, for each source file
 define
 the following "Custom Build" settings:

 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c -od"$(IntDir)"

 [Output]
 $(IntDir)\$(InputName).obj

 [as this is the same for all source files, it'd be great if I could
 define
 it for all somewhere instead of having to define it for each and every
 file]

 4. edit project settings, click project name at top of tree on left, in
 the post-build section add the command

 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

 and that's it. Hit compile and it should create a Debug/Release dir



 the .obj and .exe file in it. Put a breakpoint in and press Run and
 you're
 debugging (assuming you're in debug mode)

 --
 Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

May 26 2004
parent reply Regan Heath <regan netwin.co.nz> writes:
On Wed, 26 May 2004 23:30:48 +0200, davepermen <davepermen hotmail.com> 
wrote:
 yep, i dislike it very much, sorry. (the work is great, but its loaded 
 with
 user-interface-bugs and misbehaviours, and, together with a virescanne,
 offlinefolders, and network-shares, it gets huge problems, and always 
 fucks
 its configuration..)

Have you posted a list of these bugs to the DIDE group: http://groups.yahoo.com/group/dide/ even if you do not plan to use it, posting a list would help the dev fix them.
 i prefer an open cmdline and a good texteditor, instead..

 thats why i hope for leds..

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8ksjzu35a2sq9 digitalmars.com...
 On Tue, 25 May 2004 23:23:42 +0200, davepermen <davepermen hotmail.com>
 wrote:
 possibly we can simply replace the c++ compiler of vc6 with dmd, and 

 it to work again then? with the right compiler flags.. needs some
 hacking,
 possibly even of the exe (to change the default flags), but that 

 mather. i can co-install vc6 and vc.net 2003, and don't need vc6 for
 c++ at all anyways.. so it could get abused instead:D

Let me know how you get on.
 then again, i'm simply waiting to get leds on windows....
 one day..
 one day....

Have you tried DIDE? http://www.atari-soldiers.com/dide.html
 till then, i continue with c++, writing platform independent web, and
 mail servers for my fancy homepage, all with sdl and sdl_net and
 freeimage (yeah, i'm coming from gamedev, and i stay there:D)

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8hezx1z5a2sq9 digitalmars.com...
 Hi,

 I have managed to get MSDEV to compile and debug my D programs 


 to
 Arcane Jill for the idea)

 Here is what I did:

 1. create an MSDEV "Utility" project - these are like normal projects
 but
 they do not do the link step.

 2. add your .d source files to this project. (all of them).

 3. edit project settings, expand list on left, for each source file
 define
 the following "Custom Build" settings:

 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c 


 [Output]
 $(IntDir)\$(InputName).obj

 [as this is the same for all source files, it'd be great if I could
 define
 it for all somewhere instead of having to define it for each and 


 file]

 4. edit project settings, click project name at top of tree on left, 


 the post-build section add the command

 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

 and that's it. Hit compile and it should create a Debug/Release dir



 the .obj and .exe file in it. Put a breakpoint in and press Run and
 you're
 debugging (assuming you're in debug mode)

 --
 Using M2, Opera's revolutionary e-mail client: 



-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 26 2004
parent "davepermen" <davepermen hotmail.com> writes:
as i was away longtime from the D-Groups and other groups as well, nope, not
yet. and unsure if i will sooner or later do so, as i don't have much time..

i try to not forget.

"Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
news:opr8mqx4p65a2sq9 digitalmars.com...
 On Wed, 26 May 2004 23:30:48 +0200, davepermen <davepermen hotmail.com>
 wrote:
 yep, i dislike it very much, sorry. (the work is great, but its loaded
 with
 user-interface-bugs and misbehaviours, and, together with a virescanne,
 offlinefolders, and network-shares, it gets huge problems, and always
 fucks
 its configuration..)

Have you posted a list of these bugs to the DIDE group: http://groups.yahoo.com/group/dide/ even if you do not plan to use it, posting a list would help the dev fix them.
 i prefer an open cmdline and a good texteditor, instead..

 thats why i hope for leds..

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8ksjzu35a2sq9 digitalmars.com...
 On Tue, 25 May 2004 23:23:42 +0200, davepermen <davepermen hotmail.com>
 wrote:
 possibly we can simply replace the c++ compiler of vc6 with dmd, and

 it to work again then? with the right compiler flags.. needs some
 hacking,
 possibly even of the exe (to change the default flags), but that

 mather. i can co-install vc6 and vc.net 2003, and don't need vc6 for
 c++ at all anyways.. so it could get abused instead:D

Let me know how you get on.
 then again, i'm simply waiting to get leds on windows....
 one day..
 one day....

Have you tried DIDE? http://www.atari-soldiers.com/dide.html
 till then, i continue with c++, writing platform independent web, and
 mail servers for my fancy homepage, all with sdl and sdl_net and
 freeimage (yeah, i'm coming from gamedev, and i stay there:D)

 "Regan Heath" <regan netwin.co.nz> schrieb im Newsbeitrag
 news:opr8hezx1z5a2sq9 digitalmars.com...
 Hi,

 I have managed to get MSDEV to compile and debug my D programs


 to
 Arcane Jill for the idea)

 Here is what I did:

 1. create an MSDEV "Utility" project - these are like normal





 but
 they do not do the link step.

 2. add your .d source files to this project. (all of them).

 3. edit project settings, expand list on left, for each source file
 define
 the following "Custom Build" settings:

 [Commands]
 D:\D\dmd\bin\dmd.exe -c "$(InputPath)" -g -gt -debug -c


 [Output]
 $(IntDir)\$(InputName).obj

 [as this is the same for all source files, it'd be great if I could
 define
 it for all somewhere instead of having to define it for each and


 file]

 4. edit project settings, click project name at top of tree on left,


 the post-build section add the command

 d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\main.exe"

 and that's it. Hit compile and it should create a Debug/Release dir



 the .obj and .exe file in it. Put a breakpoint in and press Run and
 you're
 debugging (assuming you're in debug mode)

 --
 Using M2, Opera's revolutionary e-mail client:



-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

May 28 2004