I am using gpc version 20001122 under Linux and want to call GetUnixTime and GetCPUTime. These functions are mentioned under Run Time System and appear in gpc.pas, but the compiler does not recognize them. I can use GetTimeStamp, but I would like to use the others.
What do I do wrong? I have no special options selected.
Example:
program TimeTest;
begin writeln('Test for date/time functions') ; writeln(GetUnixTime(null)) ; writeln(GetCPUTime(null)) end.
$ gpc -o time-test time-test.p time-test.p: In function `pascal_main_program': time-test.p:5: undeclared identifier `Getunixtime' (first use in this routine) time-test.p:5: (Each undeclared identifier is reported only once time-test.p:5: for each routine it appears in.) time-test.p:6: undeclared identifier `Getcputime' (first use in this routine)
Thanks,
Tom Verhoeff
On 2 Dec 2000, at 22:56, Tom Verhoeff wrote:
I am using gpc version 20001122 under Linux and want to call GetUnixTime and GetCPUTime. These functions are mentioned under Run Time System and appear in gpc.pas, but the compiler does not recognize them. I can use GetTimeStamp, but I would like to use the others.
What do I do wrong? I have no special options selected.
Example:
program TimeTest;
You do not have the gpc unit in your USES clause. Insert "USES GPC;" here (without the quotation marks).
begin writeln('Test for date/time functions') ; writeln(GetUnixTime(null)) ; writeln(GetCPUTime(null)) end.
$ gpc -o time-test time-test.p
You need to supply '--automake' or '--autobuild' when you USE a unit.
This is a better command line; $ gpc --automake --executable-file-name time-test.p
or this; $ gpc --autobuild --executable-file-name time-test.p
PS: the switch '--executable-file-name' tells GPC to produce an executable that is named after the source file (i.e., 'time-test').
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku, PhD (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.24 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm