www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Windows batch file to compile D code

reply "Iain Staffell" <staffell gmail.com> writes:
Hi all.

I have been trying (quite badly) to get started with D for a 
while.

On my first attempt I gave up before even compiling Hello World, 
because it was too difficult to find out how to even compile a 
program in Windows.  (I know.. I said I was bad at this..)

Second time around I tried harder, and wrote a Windows batch file 
to make compiling and running my code easier.  No messing around 
with PATH variables or things like that, too difficult.

I have been playing around with this for a year or so now, and 
thought it might be useful to someone else trying to learn D.  So 
here is a batch file that will automatically compile and run your 
D code.

If you're interested: save http://wogone.com/code/D2.BAT.TXT to 
your computer, rename to D2.BAT, then run D2 from a command 
prompt for further instructions.

Hope someone finds it useful, and not too buggy!  Any comments or 
improvements are more than welcome.
May 03 2012
next sibling parent reply David <d dav1d.de> writes:
Am 03.05.2012 14:31, schrieb Iain Staffell:
 Hi all.

 I have been trying (quite badly) to get started with D for a while.

 On my first attempt I gave up before even compiling Hello World, because
 it was too difficult to find out how to even compile a program in
 Windows. (I know.. I said I was bad at this..)

 Second time around I tried harder, and wrote a Windows batch file to
 make compiling and running my code easier. No messing around with PATH
 variables or things like that, too difficult.

 I have been playing around with this for a year or so now, and thought
 it might be useful to someone else trying to learn D. So here is a batch
 file that will automatically compile and run your D code.

 If you're interested: save http://wogone.com/code/D2.BAT.TXT to your
 computer, rename to D2.BAT, then run D2 from a command prompt for
 further instructions.

 Hope someone finds it useful, and not too buggy! Any comments or
 improvements are more than welcome.
rdmd? http://dlang.org/rdmd.html
May 03 2012
parent reply simendsjo <simendsjo gmail.com> writes:
On Thu, 03 May 2012 15:29:07 +0200, David <d dav1d.de> wrote:

 Am 03.05.2012 14:31, schrieb Iain Staffell:
 Hi all.

 I have been trying (quite badly) to get started with D for a while.

 On my first attempt I gave up before even compiling Hello World, because
 it was too difficult to find out how to even compile a program in
 Windows. (I know.. I said I was bad at this..)

 Second time around I tried harder, and wrote a Windows batch file to
 make compiling and running my code easier. No messing around with PATH
 variables or things like that, too difficult.

 I have been playing around with this for a year or so now, and thought
 it might be useful to someone else trying to learn D. So here is a batch
 file that will automatically compile and run your D code.

 If you're interested: save http://wogone.com/code/D2.BAT.TXT to your
 computer, rename to D2.BAT, then run D2 from a command prompt for
 further instructions.

 Hope someone finds it useful, and not too buggy! Any comments or
 improvements are more than welcome.
rdmd? http://dlang.org/rdmd.html
And dvm: https://github.com/jacob-carlborg/dvm
May 03 2012
parent reply "Iain Staffell" <staffell gmail.com> writes:
On Thursday, 3 May 2012 at 18:55:17 UTC, simendsjo wrote:
 On Thu, 03 May 2012 15:29:07 +0200, David <d dav1d.de> wrote:
 rdmd? http://dlang.org/rdmd.html
And dvm: https://github.com/jacob-carlborg/dvm
Thanks both for the suggestions. RDMD looks useful, but am I right thinking I can't run it from anywhere unless I'm able to mess with PATH variables? I can't figure out where to get started with DVM, so will give that a miss.
May 04 2012
parent Jacob Carlborg <doob me.com> writes:
On 2012-05-04 12:37, Iain Staffell wrote:

 Thanks both for the suggestions. RDMD looks useful, but am I right
 thinking I can't run it from anywhere unless I'm able to mess with PATH
 variables?
DVM will handle this for you.
 I can't figure out where to get started with DVM, so will give that a miss.
simendsjo linked to the new URL, where no pre-compile binaries exist yet. Use this old URL until the next release: https://bitbucket.org/doob/dvm/wiki/Home 1. Download the tool: https://bitbucket.org/doob/dvm/downloads 2. run "dvm.exe install dvm" 3. open a new console window 4. run "dvm install 2.059" 5. run "dvm use 2.059" 6. now "dmd" and "rdmd" will be available You can also add the "-d" flag to the "use" command. This will set the compiler as the default compiler. Instructions are available at the URL above. -- /Jacob Carlborg
May 04 2012
prev sibling parent reply Manu <turkeyman gmail.com> writes:
Are you a visual studio user? Tried VisualD?
If not, tried Mono-D?

On 3 May 2012 15:31, Iain Staffell <staffell gmail.com> wrote:

 Hi all.

 I have been trying (quite badly) to get started with D for a while.

 On my first attempt I gave up before even compiling Hello World, because
 it was too difficult to find out how to even compile a program in Windows.
  (I know.. I said I was bad at this..)

 Second time around I tried harder, and wrote a Windows batch file to make
 compiling and running my code easier.  No messing around with PATH
 variables or things like that, too difficult.

 I have been playing around with this for a year or so now, and thought it
 might be useful to someone else trying to learn D.  So here is a batch file
 that will automatically compile and run your D code.

 If you're interested: save
http://wogone.com/code/D2.BAT.**TXT<http://wogone.com/code/D2.BAT.TXT>to your
computer, rename to D2.BAT, then run D2 from a command prompt for
 further instructions.

 Hope someone finds it useful, and not too buggy!  Any comments or
 improvements are more than welcome.
May 03 2012
parent "Iain Staffell" <staffell gmail.com> writes:
On Thursday, 3 May 2012 at 16:29:48 UTC, Manu wrote:
 Are you a visual studio user? Tried VisualD?
 If not, tried Mono-D?
EditPad is as far as I go! I tried using Code::Blocks about a year ago, but couldn't get it to play nicely with the compiler...
May 04 2012