Page 1 of 1

Setting up the DMC C/C++ Compiler

Posted: Wed Nov 06, 2013 5:56 am
by jussij
To setup the DMC C/C++ compiler just do the following:

1) Download the DM C/C++ compiler zip file from this location.

To use thinks like <iostream> and other STL features remember to also download STL port from the same link.

2) Open the zip file and unpack the DM folder contained to some disk location, for example:

Code: Select all

C:\Program Files\dm
The DM bin folder will also need to be added to the PATH environment variable.

Code: Select all

C:\Program Files\dm\bin
Details on how to do this can be found here.

3) Start Zeus and to test the PATH change from above use the Tools, DOS Command Line menu and run this command:

Code: Select all

If the bin folder is in the PATH you should see this output inside Zeus:

Code: Select all

Digital Mars Compiler Version 8.42n
Copyright (C) Digital Mars 2000-2004.  All Rights Reserved.
Written by Walter Bright
DMC is a one-step program to compile and link C++, C and ASM files.
Usage ([] means optional, ... means zero or more):

	DMC file... [flags...] [@respfile] 

file...		.CPP, .C or .ASM source, .OBJ object or .LIB library file name
4) Use the Options, Document Types menu to edit the C/C++ Document Type adding in this command line to the Compiler section:

Code: Select all

dmc.exe "$fn"
That command line will compile and link the current file.

5) Create a simple test.cpp file as follows:

Code: Select all

#include <stdio.h>

int main(int argc, char *argv[])
  printf("Hello DMC World!");
  return 1;
6) Use the Compiler, Compile menu to compile and link this file.

7) Using the Macros, Execute 'test.exe' menu to run the resulting executable should produce this output:
Hello DMC World!
Cheers Jussi