Difference between revisions of "4/Development setup"

From Worms Knowledge Base

Jump to: navigation, search
(first half)
 
m (ae and requisites: Never mind about the spaces)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ParentArticle|4}}
+
{{ParentArticle|[[4]]}}
This page describes how to set up a working development environment with D and [https://github.com/CyberShadow/ae ae] on Windows, and build the sample ae demos.
+
This page describes how to set up a working development environment with D and [https://github.com/CyberShadow/ae Armageddon Engine] on Windows, and build the sample ae demos.
  
 
== D ==
 
== D ==
 
There are two versions of the language: D 1 and 2. D2 is the current version, thus commonly referred to as just "D".
 
There are two versions of the language: D 1 and 2. D2 is the current version, thus commonly referred to as just "D".
  
Warning: The D installer is known to truncate the system PATH environment variable over a certain limit. (If you don't know what this means, it most likely doesn't apply to you.)
+
* Proceed to the [http://dlang.org/download.html D download page], and download the current "dmd D 2.0 compiler 1-click install for Windows".
 +
** On the component selection screen, uncheck "D 1".
  
* Download and run the [http://ftp.digitalmars.com/dinstaller.exe D Windows installer].
+
== Git ==
* On the component selection screen, feel free to uncheck "D 1".
+
[http://git-scm.com/ Git] is a [[w:source control]] system. ae and its dependencies are stored in git.
 +
 
 +
[http://git-scm.com/download/win Download] and install the Windows version of git.
 +
* At '''Adjusting your PATH environment''', select one of the first two options.
 +
* At '''Choosing the SSH executable''', select '''Use OpenSSH'''.
 +
* At '''Configuring the line ending conventions''', select '''Checkout as-is, commit as-is'''.
 +
 
 +
== ae and requisites ==
 +
* Create a work directory which will contain all the source code.
 +
 
 +
* Right-click on the newly-created work directory, and select '''Git Bash'''.
 +
 
 +
* At the prompt, type (without the <tt>$</tt> signs):
 +
 
 +
$ git clone https://github.com/CyberShadow/ae
 +
$ git clone https://github.com/CS-svnmirror/dsource-bindings-win32 win32
 +
$ git clone https://bitbucket.org/cybershadow/derelict.git
 +
 
 +
* Go back to the work directory, and copy the path to it from the address bar.
 +
{{gap}}
 +
* Navigate to <code>C:\D\dmd2\windows\bin</code>, and open <code>sc.ini</code> in Notepad.
 +
* Find the line starting with <code>DFLAGS=</code>
 +
* At the end of the line, type a space, then <code>"-I</code>, then paste the path copied above, then type <code>"</code> to close the quotes.
 +
: [[File:ae-setup-dmd-scini.png|thumb|600px|none|Example correct sc.ini]]
 +
* Save and close the file.
 +
 
 +
* You will also need to [http://www.libsdl.org/download-2.0.php download the SDL2 DLL] (you'll need the Runtime binary for 32-bit Windows). Place the DLL in the folder you created.
 +
 
 +
You should now be able to compile and run the PewPew demo by running the following command from the work directory:
 +
 
 +
$ rdmd ae/demo/pewpew/pewpew
 +
 
 +
For improved performance, you can create and run a release build with the command:
 +
 
 +
$ rdmd -O -inline -release ae/demo/pewpew/pewpew
 +
 
 +
Below are instructions for setting up an editor or IDE, for more comfortable development.
 +
 
 +
<!--
 +
>>>>>>>>>>>>>> Visual D is blocked by http://www.dsource.org/forums/viewtopic.php?p=27618 <<<<<<<<<<<<<<<
  
 
== Visual D ==
 
== Visual D ==
Line 17: Line 57:
 
* Download and install [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=115 Visual Studio 2010 Shell], if needed.
 
* Download and install [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=115 Visual Studio 2010 Shell], if needed.
 
* Download and run the Visual D installer from [http://dsource.org/projects/visuald Visual D's project page].
 
* Download and run the Visual D installer from [http://dsource.org/projects/visuald Visual D's project page].
 +
** On the '''DMD Installation Folder''' page, enter: <code>C:\D\dmd2</code>
 +
 +
* Open Visual Studio / Visual Studio Shell.
 +
* From the '''Tools''' menu, select '''Options'''.
 +
* From the '''Projects and Solutions''' category on the left, select '''Visual D Directories'''.
 +
* In the '''Import paths''' box, paste the path to the folder you created.
 +
** (example image goes here)
 +
* Click OK.
 +
-->
 +
<!--
 +
>>>>>>>>>>>>>> Mono-D has the same issues as Visual-D <<<<<<<<<<<<<<<
 +
 +
== Mono-D ==
 +
Mono-D is a plugin adding D support for MonoDevelop.
 +
 +
* Download and install [http://monodevelop.com/ MonoDevelop] and its dependencies.
 +
* Follow the [http://mono-d.sourceforge.net/?page_id=9 Mono-D installation instructions].
 +
* Follow the [http://mono-d.sourceforge.net/?page_id=11 "Getting Started" guide], too.
 +
  * On the 4th step, also add the path to your d-stuff folder.
 +
* ???
 +
* Profit!
 +
 +
 +
== SDL runtime ==
 +
You'll need the SDL 1.2 runtime to run the SDL demos.
 +
 +
* Download the Win32 runtime library from the [http://www.libsdl.org/download-1.2.php SDL 1.2 download page].
 +
* Place <code>SDL.dll</code> in your project's directory, or somewhere on the system path (e.g. <code>C:\Windows</code>)
 +
 +
-->
 +
 +
== Geany ==
 +
There are many editors and IDEs supporting D. This page describes setting up Geany, but there are many others available. If you're feeling adventurous, you can try experimenting with some of the editors and IDEs on [http://prowiki.org/wiki4d/wiki.cgi?EditorSupport this page].
 +
 +
* Download and run the Windows Geany installer (with GTK) from the [http://www.geany.org/Download/Releases Geany download page].
 +
* Start Geany, and open a D file (for example, <code>ae/demo/pewpew/pewpew.d</code>).
 +
* From the '''Build''' menu, select '''Set build commands'''
 +
* In the edit box near the '''Build''' button (in the '''Command''' column), replace the command with: <code>rdmd --build-only -w -g -of.\ "%f"</code>
 +
: [[File:ae-setup-geany-buildtools.png|thumb|400px|none|Screenshot]]
 +
* You should now be able to compile the current file with '''F8''', build the currently-opened D program with '''F9''', and run it with '''F5'''.
 +
* To create optimized builds (which catch less programming errors and are unsuitable for debugging, but run faster), use this '''Build''' command line: <code>rdmd --build-only -w -O -inline -release -of.\ "%f"</code>
 +
<!--
 +
Notes:
 +
Entice - OK but outdated, simplistic (no jump-to-error)
 +
D-IDE - buggy-ish, no build tool support
 +
Geany - a bit laggy (GTK), freezes while building/running
 +
Zeus - shareware
 +
-->
 +
 +
== Troubleshooting ==
 +
 +
;Warnings about missing rpcns4.lib, mpr.lib, version.lib
 +
:These warnings can be safely ignored.
 +
;Derelict SharedLibLoadException
 +
:The program could not find the SDL DLL. Copy SDL2.dll in the program's folder, or to any folder in the system PATH (e.g. <code>C:\Windows</code>).

Latest revision as of 02:21, 13 July 2014

(Up to 4)

This page describes how to set up a working development environment with D and Armageddon Engine on Windows, and build the sample ae demos.

D

There are two versions of the language: D 1 and 2. D2 is the current version, thus commonly referred to as just "D".

  • Proceed to the D download page, and download the current "dmd D 2.0 compiler 1-click install for Windows".
    • On the component selection screen, uncheck "D 1".

Git

Git is a w:source control system. ae and its dependencies are stored in git.

Download and install the Windows version of git.

  • At Adjusting your PATH environment, select one of the first two options.
  • At Choosing the SSH executable, select Use OpenSSH.
  • At Configuring the line ending conventions, select Checkout as-is, commit as-is.

ae and requisites

  • Create a work directory which will contain all the source code.
  • Right-click on the newly-created work directory, and select Git Bash.
  • At the prompt, type (without the $ signs):
$ git clone https://github.com/CyberShadow/ae
$ git clone https://github.com/CS-svnmirror/dsource-bindings-win32 win32
$ git clone https://bitbucket.org/cybershadow/derelict.git
  • Go back to the work directory, and copy the path to it from the address bar.

 

  • Navigate to C:\D\dmd2\windows\bin, and open sc.ini in Notepad.
  • Find the line starting with DFLAGS=
  • At the end of the line, type a space, then "-I, then paste the path copied above, then type " to close the quotes.
Example correct sc.ini
  • Save and close the file.
  • You will also need to download the SDL2 DLL (you'll need the Runtime binary for 32-bit Windows). Place the DLL in the folder you created.

You should now be able to compile and run the PewPew demo by running the following command from the work directory:

$ rdmd ae/demo/pewpew/pewpew

For improved performance, you can create and run a release build with the command:

$ rdmd -O -inline -release ae/demo/pewpew/pewpew

Below are instructions for setting up an editor or IDE, for more comfortable development.


Geany

There are many editors and IDEs supporting D. This page describes setting up Geany, but there are many others available. If you're feeling adventurous, you can try experimenting with some of the editors and IDEs on this page.

  • Download and run the Windows Geany installer (with GTK) from the Geany download page.
  • Start Geany, and open a D file (for example, ae/demo/pewpew/pewpew.d).
  • From the Build menu, select Set build commands
  • In the edit box near the Build button (in the Command column), replace the command with: rdmd --build-only -w -g -of.\ "%f"
Screenshot
  • You should now be able to compile the current file with F8, build the currently-opened D program with F9, and run it with F5.
  • To create optimized builds (which catch less programming errors and are unsuitable for debugging, but run faster), use this Build command line: rdmd --build-only -w -O -inline -release -of.\ "%f"

Troubleshooting

Warnings about missing rpcns4.lib, mpr.lib, version.lib
These warnings can be safely ignored.
Derelict SharedLibLoadException
The program could not find the SDL DLL. Copy SDL2.dll in the program's folder, or to any folder in the system PATH (e.g. C:\Windows).
Personal tools