POV-Ray : Newsgroups : povray.binaries.programming : command line : Re: command line Server Time
25 Apr 2024 10:58:06 EDT (-0400)
  Re: command line  
From: Halbert
Date: 8 Mar 2002 22:45:07
Message: <3c898543@news.povray.org>
"majucatur" <maj### [at] yahoocom> wrote in message
news:3c8504b5@news.povray.org...
> Another example:
>
> program.c - - - - -
>
> #include <math.h>
> #include <stdio.h>
>
> void main() {
>    float Var;
>    printf("\nA number :");
>    scanf("%f", Var);
>    printf("\n\nThe square root of %f is %f\n", Var, sqrt(Var));
>    getch();
> }
>
> - - - - -
>
> that's all, how can I compile this in the command line?
>

I used Borland C++ from 1994-1997
Try:

tcc -ms program.c -oprogram.obj

Long ago when I used Borland C++ there was also command line options to use
floating point emulation (the default) and another to use the x87 library. I
don't know if such is the case with newer versions (that is how long it has
been since I used the Borland compilers.) -f87 for 8087 and -f287 for 80287.
This would precede the input file name.

After you compile and have the .obj(s) then you need to link it. When
I used the compilers, I had to use a memory model.

c0t.obj    tiny model(used for things like .com files. The program segment
prefix (PSP) is different for this model and there is no stack segment)
c0s.obj    for small model (appropriate for the source given.)
c0c.obj    for compact
c0m.obj    for medium
c0l.obj for large
c0h.obj    for huge

The linker that came with Borland was tlink.

tlink  /c  \Borlandc\lib\c0s program, program,,\borlandc\lib\maths
\borlandc\lib\cs

The /c makes the symbols case sensitive. the next two items are the .obj
files for this compile. First the small version standard c startup module
(along with the path)  then the program.obj we compiled before. the next
item is the output executable: program.exe. the ommited option is for a map
file. Last are the two small version libraries used: maths.lib for the sqrt
function, then cs the small version standard c library.

Keep in mind that I seldom use command line compilers these days and it has
been years since I've used Borland. Let me know if my take on dos-mode
command line compilers is too medieval. I hope this is at least partly
useful. I have the documentation around here somewhere in a box. If I find
it I will scan the relevent sections for you.



Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.