[fpc-pascal] Nano-x
Michael Van Canneyt
michael at freepascal.org
Thu Jul 20 09:56:46 CEST 2006
On Thu, 20 Jul 2006, Carsten Bager wrote:
> I am trying to write a small program using the nano-x library.
>
> -----------------
> Unit NanoX;
> interface
> {$mode objfpc}
> Const
> LibNanoX='nano-X';
>
> function GrOpen:longint;cdecl;external LibNanoX;
>
> implementation
> end.
>
> ------------------
>
> program Nanoxdemo;
>
> uses
>
> NanoX,linux,sysutils;
>
> begin
> if GrOpen < 0 then
> WriteLn('Can not open graphics')
> else WriteLn('Graphics open');
> end.
>
> When linking, I get a lot of errors like this
You need to link to the C library as well.
So, add
{$linklib c}
to your sources.
Michael.
> -----------------
>
> Linking nanoxdemo
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `strcpy'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `ioctl'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `stdout'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `vsprintf'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `connect'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `munmap'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `getenv'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `getpid'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `getpagesize'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `fgets'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `memcpy'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__floatsidf'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `puts'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `feof'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `malloc'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__udivsi3'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `socket'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `select'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `mmap'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `alarm'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `nanosleep'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `calloc'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__fixdfsi'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `write'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `fprintf'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__umodsi3'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `ferror'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `signal'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `read'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `realloc'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `sscanf'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__divdf3'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__muldf3'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `fopen'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `fclose'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `stderr'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `fwrite'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__errno_location'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `exit'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `setbuf'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `strlen'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `open'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__assert'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to
> `__subdf3'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `close'
> L:\Pas\ReleasedUnits\LibArm9\/libnano-X.so: undefined reference to `free'
> nanoxdemo.pas(10,31) Error: Error while linking
>
> -------------
>
> Some of the names are in the libc library, witch is present, others are in
> libraries witch I do not have on the compiling PC (cross compiling from
> Windows to Arm Linux).
>
> What do I have to do to get moving?
>
> Carsten
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list