Please note that the C library contained herein expects that the main function provided by the user program is ZMAIN rather than MAIN. This is because the DEC compiler treats the symbol MAIN as a special case and this library does not support any special entry points that the DEC compiler generates. The change is simple: just change the name of your main to zmain. The following program is then included in your link file, .title main ;needed for dec c compiler .ident /main01/ .entry main,^m<> jmp zmain+2 .end and you link as follows, $ here := SYS$DISK:'F$DIRECTORY()' $link/exe=grep/nouserlib/map='here'grep.map sys$input/opt,- 'here'cheader,main,- 'here'grep, - runtime/lib !sys$library:runtime99.exe/shareable=nocopy $!end The symbol HERE is just shorthand for the current default directory. Note "cheader,main" precedes your module(s) and runtime/lib follows. The module cheader has a transfer address (making it a true main program) which calls an internal routine to parse the command line followed by a call to main(argc,argv). The program main.mar (as shown above) just transfers control to zmain. This allows us to avoid declaring main in a C program which causes some extra code to be generated that we do not want. Note the line !sys$library:runtime99.exe/shareable=nocopy this may be added (remove comment) if you build the library as a shared library. Then, runtime99.exe (the 99 is added to avoid collisions since libraries go into sys$library). The file makelib.com is used to build it. Feel free to distribute this library as you wish. It contains public domain objects only. This library is also an update to a prior library that was on a DECUS tape a few years back. Eric Levy 6-11-84