Sign in Join

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

Mailing lists / fpc-devel / 2006-02

GUID's under Linux

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

How to I create a GUID under Linux? I executed the code below under Windows without error. I then tested my code under Linux and it tells me "Identifier not found 'CreateGUID'". When I Ctrl+Click on CreateGUID, it takes me to sysutilh.inc at line 174, which is a function that does exist!

I am running Ubuntu Linux 5.10, Lazarus 0.9.13 and FPC 2.0.2

uses
 SysUtils;
...
var
 lGUID : TGUID;
begin
 CreateGUID(lGUID);

Regards,
- Graeme -

Reply by email

Jonas Maebe
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
How to I create a GUID under Linux? I executed the code below under Windows without error. I then tested my code under Linux and it tells me "Identifier not found 'CreateGUID'". When I Ctrl+Click on CreateGUID, it takes me to sysutilh.inc at line 174, which is a function that does exist! I am running Ubuntu Linux 5.10, Lazarus 0.9.13 and FPC 2.0.2

It works fine for me with fpc 2.0.2 under Darwin, can't see either why it wouldn't work on Linux.

Jonas

Reply by email

Marco van de Voort
to Jonas Maebe
Show quoted text 12 lines
On 16 feb 2006, at 08:00, Graeme Geldenhuys wrote: > How to I create a GUID under Linux? I executed the code below under > Windows without error. I then tested my code under Linux and it tells > me "Identifier not found 'CreateGUID'". When I Ctrl+Click on > CreateGUID, it takes me to sysutilh.inc at line 174, which is a > function that does exist! > > I am running Ubuntu Linux 5.10, Lazarus 0.9.13 and FPC 2.0.2 It works fine for me with fpc 2.0.2 under Darwin, can't see either why it wouldn't work on Linux.

Implementations don't seem the same?

- Linux seems to try kernel then falls back to generating an own using urandom.
- Solaris, FreeBSD4 and Darwin always use urandom.
- FreeBSD5 uses syscall or libc function depending on FPC_USE_LIBC

I assume Solaris/Darwin could attempt kernel generation too (depending on major OS version maybe, like FreeBSD), Linux is missing libc implementation and always does an own thing bypassing system libs.

Reply by email

Jonas Maebe
to Marco van de Voort
Marco van de Voort wrote 13 lines
>> How to I create a GUID under Linux? I executed the code below under >> Windows without error. I then tested my code under Linux and it >> tells >> me "Identifier not found 'CreateGUID'". When I Ctrl+Click on >> CreateGUID, it takes me to sysutilh.inc at line 174, which is a >> function that does exist! >> >> I am running Ubuntu Linux 5.10, Lazarus 0.9.13 and FPC 2.0.2 > > It works fine for me with fpc 2.0.2 under Darwin, can't see either > why it wouldn't work on Linux. Implementations don't seem the same?

His problem is that it doesn't compile at all, not that it doesn't work.

Jonas

Reply by email

Graeme Geldenhuys
to Jonas Maebe

Under Linux it uses some kernel file (/var/proc/....) which if I "cat" returns a different GUID everytime, so that part works.

His problem is that it doesn't compile at all, not that it doesn't work.

Yup, so does that mean everybody else can compile and use CreateGUID under Linux? If so, I guess I will download a fresh copy of FPC, and see if that sorts out my problem.

Regards,
- Graeme -

Reply by email