> I'm trying compile a project using FreePascal (2.0.2 [2005/11/17] for i386)
> in a FreeBSD 4.1.
That's an old one (the FreeBSD I mean)
> I can compile this project in Delphi (in a Windows) and Kylix (in a Debian),
> but infortunatelly I can't compile this project using FreePascal/FreeBSD.
That's because you
1) use OS specific units for something not OS specific.
-> Best solution: use sysutils.getenvironmentvariable
2) For the *nix case, you use a Kylix compability unit (libc) which, like
Kylix, is linux/i386 only.
-> if you want to do this use baseunix.fpgetenv
> to use the getenv function.
> What the correspondent for FreeBSD to Libc?
Those help files are too complex for me to understand.
In there I find no getenv function,
only GetEnvironmentStrings and GetEnvironmentVariable.
If I learn more I will let you know.
>From: "Evandro Sestrem" <[hidden email]>
>Reply-To: FPC-Pascal users discussions <[hidden email]>
>To: <[hidden email]>
>Subject: [fpc-pascal] FreePascal in a FreeBSD
>Date: Thu, 12 Jan 2006 16:46:04 -0300
>I'm trying compile a project using FreePascal (2.0.2 [2005/11/17] for i386)
>in a FreeBSD 4.1.
>I can compile this project in Delphi (in a Windows) and Kylix (in a
>but infortunatelly I can't compile this project using FreePascal/FreeBSD.
>I have this code:
>to use the getenv function.
>What the correspondent for FreeBSD to Libc?
>Thanks in advance!
>No virus found in this outgoing message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.17/227 - Release Date: 11/1/2006
>fpc-pascal maillist - [hidden email] >http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> Thank you very much, Marco! You really helped me a lot.
> Pierre: you can use de BaseUnix.GetEnvironmentVariable almost the same like
> you use Windows.GetEnvironmentVariable in Delphi.
baseunix.fpgetenv it is :-)
baseunix mostly contains Unix calls prefixed with "fp" to avoid unnecessary
> Now I'm looking for correspondents for these Windows APIs in the FreePascal:
> - LoadLibrary (Linux: dlopen)
> - FreeLibrary (Linux: dlclose)
> - GetProcAddress (Linux: dlsym)
> Can somebody help me?
Use unit dynlibs. These calls are abstracted in that unit to work over all
OSes that support such functionality.