Does anyone know of a decent C compiler that can compile programs that run in dos and don't require Win32?
-Thanks-
Printable View
Does anyone know of a decent C compiler that can compile programs that run in dos and don't require Win32?
-Thanks-
Take a look at www.thefreecountry.com/developercity/. In this city there is a place where you can find C compilers, also for DOS.
You could also take a look at Borland's site, there you can download a number of compilers for free. I thought that good old Turbo C was also present to be downloaded. And else look at Pacific C at www.htsoft.com/products/pacific.html, a good one, and Digital Mars C (?) and GCC can compile DOS programs, though you need to download special libraries for that.
I have The Digital Mars compiler, it is the compiler I have been using for a couple months now, I have downloaded the libraries for 16 bit dos and placed them in the correct folders I just havn't been able to figure out how to tell the compiler that I want it to be dos 16 bit not win32. What would the command line arguments be?
I'm sorry, I don't know, isn't it in the documentation? Have you checked which parameters you can pass to the compiler and the linker?
Perhaps there's a compiler switch which needs to be turned on.
And what about trying a different compiler? The Turbo C compiler and Pacific C are very easy to install and use.
I have looked all threw the documentation and their site... and tried all of the possible arguments I found but with no success... thanks anyway for your help! :)
In the Compiler & Tools Guide at
http://www.digitalmars.com/ctg/ctg.html
There seem to be some compiler switches which could be useful to include in your code:
_MSDOS
DOS16RM
I guess if you turn one (or perhaps both) of these switches on in your code, the compiler knows that it should generate DOS code.
There are two options which you could supply the compiler with, which look quite useful, "-f" and "-md". Where f means that 16 bit code should be generated and md is memory model type d where d is for 16 bit.
Have you setup the environment variables for the linker right?
[QUOTE from Compiler & Tools Guide]
LIB
Supplies paths to search for libraries, object files, and resource files. See also /SCANLIB.
TMP
Supplies a path used by OPTLINK for its virtual memory file. Otherwise, the current directory is used. OPTLINK's performance can be severely slowed when its virtual memory file must be stored across a network.
LINK
Supplies linker switch settings. Recognized for Microsoft LINK compatibility. See also /SCANLINK.
OPTLINKS
Supplies linker switch settings. OPTLINKS is scanned after the LINK variable and can override any previous settings specified.
OBJ
Supplies paths to be searched by OPTLINK for .obj files not found in the current working directory. Paths specified by OBJ are always searched before any paths specified by the LIB environment variable.
PATH
[/QUOTE]
I'm not sure if I interpreted the information correctly. Perhaps you could contact Jan Knepper, http://www.janknepper.com/, he seems to be the guy maintaining the website. Maybe he knows the answer, at least I think he knows the right persons to answer your question. His e-mail: [email protected].
Or you could try the newsgroup at
http://www.digitalmars.com/NewsGroup.html