Re: Compiling simple old UNIX program



(1) atoi() You need to use strotol() instead. Replace atoi(argv[++])
with strotol(argv[++],NULL,0). You will probably need to add #include
<stdlib.h> and #include <limits.h> at the top of the file.

(2) system() You didn't say is this to be compiled on an OS X system
or OS 8,9 system ? If OS 8 or 9 you have a problem because
system(command) means run "command" on the command line and systems 8,9
didn't have one so this won't work and you will have to figure out some
other way to do it.
If OS X then it should work and the #include <stdlib.h> should make it
happy. If this doesn't work you have some alternatives. First if you
have the development tools installed you might be able to type cc <your
app>.c on the command line of Terminal and it might just compile and
build a.out which would run. If not XCode building a standard tool
stationary project would probably work just fine (with the above atoi
fix done).

.



Relevant Pages

  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • RE: Console Application Testing
    ... vbc.exe could be accessed in Visual Studio Command ... If you want to compile the project in command prompt with vbc.exe, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Macro prompt
    ... I'm sorry, Pcman, I don't think I can help here. ... If you want to test the action of clicking a command button on a form, I suggest you test it by clicking the command button on the form, not by trying to run the Click event code from within the VBE window. ... Steve Schapel, Microsoft Access MVP ... options pop-up menu the the "Compile" section has already checked off Compile ...
    (microsoft.public.access.macros)
  • Re: Using MATLAB functions in C code
    ... interface to MATLAB engine.When I tried to ... option files needed.The command is as follows: ... MATLAB fft amd ifft functions.I just want to compile them like: ... int mlhs, mrhs; ...
    (comp.soft-sys.matlab)
  • Re: [SLE] Compile problem
    ... > This is the first compile time problem I have faced in my relatively short ... So ERRORs stop you getting output, WARNINGs alert you to be ... Make sure that from your command line, ... can you engage any response from the command?] ...
    (SuSE)