Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-12

GetEpochTime not found

8 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

I've got some funny problem here. The program compiled well with fpc up to version 1.9.4. I haven't touched it for a while and now it fails with fpc 2.0.2.

The source snippet in queston is:

function TStorable.generateID: integer;
begin
//writeln(GetEpochTime); does not work anymore
result := sysutils.GetEpochTime(); // does not work either
//result := fpTime; // this works!
end;

As you can see I've tried prefixing with the correct unit specifier but it fails:

CommonTypes.pp(207,21) Error: Identifier not found "GetEpochTime"

Checking the source and even grep'ping and strings'ing sysutils.ppu and sysutils.o the function GetEpochTime is there:

$ grep GetEpochTime /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu
Binary file /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu matches

But the compiler doesn't find it:

from fpc ... -vt
...
PPU Loading /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu ...

I'm stuck, what is missing here or how can I go on debugging the problem?

TIA,
Marc

Michael Van Canneyt
to Marc Santhoff
Marc Santhoff wrote 35 lines
Hi, I've got some funny problem here. The program compiled well with fpc up to version 1.9.4. I haven't touched it for a while and now it fails with fpc 2.0.2. The source snippet in queston is: function TStorable.generateID: integer; begin //writeln(GetEpochTime); does not work anymore result := sysutils.GetEpochTime(); // does not work either //result := fpTime; // this works! end; As you can see I've tried prefixing with the correct unit specifier but it fails: CommonTypes.pp(207,21) Error: Identifier not found "GetEpochTime" Checking the source and even grep'ping and strings'ing sysutils.ppu and sysutils.o the function GetEpochTime is there: $ grep GetEpochTime /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu Binary file /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu matches But the compiler doesn't find it: from fpc ... -vt ... PPU Loading /home/marc/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/rtl/sysutils.ppu ... I'm stuck, what is missing here or how can I go on debugging the problem?

Nothing is missing. getepochtime is present in the Sysutils unit, but is not exposed, as it's not cross platform. You should be using fptime.

Michael.

Marco van de Voort
to Marc Santhoff: I've got some funny problem here. The program compiled well with fpc up to version 1.9.4.…
I've got some funny problem here. The program compiled well with fpc up to version 1.9.4. I haven't touched it for a while and now it fails with fpc 2.0.2.

Afaik there was only a *nix implementation and that was already covered by the Unix (fp)time function, so it got cleaned up in 2.0 in the cleanup's after the implementation of the Exec* functions.

I'm stuck, what is missing here or how can I go on debugging the problem?

Nothing, just use fptime.

Marco van de Voort
to Micha Nelissen
Show quoted text 9 lines
Marco van de Voort wrote: >>> fpc 2.0.2. >>> >>> CommonTypes.pp(207,21) Error: Identifier not found "GetEpochTime" >> http://www.freepascal.org/docs-html/rtl/oldlinux/getepochtime.html > > He uses FreeBSD. Ah right, this was apparent from the unit path.

Not that I'd recommend oldlinux to linux/x86 users though. It was really only meant to recompile unmaintained old stuff for the 1->2 transition.

IMHO we can disable it for 2.2 too.

Marc Santhoff
to Michael Van Canneyt: Nothing is missing. getepochtime is present in the Sysutils unit, but is not exposed, as…
Michael Van Canneyt wrote 5 lines
> I'm stuck, what is missing here or how can I go on debugging the > problem? Nothing is missing. getepochtime is present in the Sysutils unit, but is not exposed, as it's not cross platform. You should be using fptime.

Far more simple than I thought, I had started fiddling paths and the like ... :)

Thanks for all helping hands,
Marc