[fpc-pascal] Program exited with code 01

2007-05-04 Thread josepascual (almudi)
Hi Everyone,


I have compiled hello_eabi_arm (hello world!) with ppcrossarm and -GfSOFT
option.

I can run a hello world program with no problem (ldd say me there is not
libraries needed)
but if I use dl.pp I received next error (write below), ldd say libdl and
libc.so.6 are needed.

any suggestion? how can I discover what file or directory is missing for
program,

=
>$ ./hello_eabi_arm
-bash: ./ hello_eabi_arm: No such file or directory 

>$ gdb hello_eabi_arm 

GNU gdb 6.5-debian Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /tmp/hello_eabi_arm
/bin/bash: /tmp/hello_eabi_arm: No such file or directory
/bin/bash: /tmp/hello_eabi_arm: Success

Program exited with code 01.
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers and track explicitly
loaded dynamic code.
You can't do that without a process to debug.
(gdb)
=

thanks,
regards

Jose Pascual


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal] some problem in SVN FPC for arm linux (v 2.3.1)

2007-05-04 Thread Helmut Hartl
Hello again Henry,

>  >
>  > i used the "mastermakefile" to build the tool chain:
>  > http://www.nslu2-linux.org/wiki/Development/MasterMakefile
>  >

I followed the
http://www.nslu2-linux.org/wiki/HowTo/CrossCompileWithCentOS
Worked for me for CentOS 5, i built the slugosle 4.4 and flashed it.
Then i copy'ed the generated crosstoolchain and used it to make a 
cross compileing fpc 2.3.1 from svn head.

Many thanks for your help !!
A simple "FPC only Hello World" programm compiled works perfect on the
NSLU2.

>  > this is the _only_ toolchain that worked for me, since i had
>  > to link against external libs.  if you're writing a
>  > stand-alone fpc app, you might get away by using any old binutils.
>  >

But a you predicted :-( i now have problems linking against an external
library.
I want to use unit "dynlibs" to dynamically load the "libc.so.6" on the
NLSU2 
(i have done this under i386 linux sucessfully)

But i get the following error:

Free Pascal Compiler version 2.3.1 [2007/05/03] for arm
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for ARM
Compiling nslu_test.lpr
Assembling nslu_test
Linking nslu_test
/usr/local/lib/fpc/2.3.1/units/arm-linux/rtl/cprt0.o: In function
`_haltproc':
: undefined reference to `_fini'
/usr/local/lib/fpc/2.3.1/units/arm-linux/rtl/cprt0.o: In function
`_haltproc':
: undefined reference to `_init'
nslu_test.lpr(6,17) Error: Error while linking
nslu_test.lpr(6,17) Fatal: There were 1 errors compiling module,
stopping


The source is:
---
program nslu_test;
{$mode objfpc}{$H+}
uses dynlibs;

begin
 writeln('Hello');
end.
---

Have you again any hints for me ?

Thanks,

helmut



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] some problem in SVN FPC for arm linux (v 2.3.1)

2007-05-04 Thread Marco van de Voort
> But a you predicted :-( i now have problems linking against an external
> library.
> I want to use unit "dynlibs" to dynamically load the "libc.so.6" on the
> NLSU2 
> (i have done this under i386 linux sucessfully)

dynlibs links statically to libc.so.6 to access dlopen et al.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] some problem in SVN FPC for arm linux (v 2.3.1)

2007-05-04 Thread Henry Vermaak

On 04/05/07, Helmut Hartl <[EMAIL PROTECTED]> wrote:

But a you predicted :-( i now have problems linking against an external
library.
I want to use unit "dynlibs" to dynamically load the "libc.so.6" on the
NLSU2
(i have done this under i386 linux sucessfully)



why do you want to load libc dynamically?  may you can try the
following approach (scroll to bottom):

http://community.freepascal.org:1/docs-html/prog/progse53.html#x240-24300012.3

henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal] some problem in SVN FPC for arm linux (v 2.3.1)

2007-05-04 Thread Helmut Hartl
> why do you want to load libc dynamically?  may you can try
> the following approach (scroll to bottom):
> http://community.freepascal.org:1/docs-html/prog/progse53

Well - that was what i would like to do - I thougt i try it
using libc, as i hade some old code who was doing it just that way.

But also the following:

program nslu_test;
{$mode objfpc}{$H+}
{$linklib c}
begin
 writeln('Hello');
end. 

> ppcrossarm -XParm-linux- -CfSOFT nslu_test.lpr -Xd -Xr/usr/armlib

Fails with:

Free Pascal Compiler version 2.3.1 [2007/05/03] for arm
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for ARM
Compiling nslu_test.lpr
Assembling nslu_test
Linking nslu_test
/usr/local/lib/fpc/2.3.1/units/arm-linux/rtl/cprt0.o: In function
`_haltproc':
: undefined reference to `_fini'
/usr/local/lib/fpc/2.3.1/units/arm-linux/rtl/cprt0.o: In function
`_haltproc':
: undefined reference to `_init'
nslu_test.lpr(7,17) Error: Error while linking
nslu_test.lpr(7,17) Fatal: There were 1 errors compiling module,
stopping
Fatal: Compilation aborted


Am i using the compiler switches wrong? 
In "/usr/armlib" are the objects files of the slugosle build process ...

Thank you,

helmut
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Using the FPCanvas unit (in fpGUI)

2007-05-04 Thread Graeme Geldenhuys

Hi,

If I wanted to start using the FPCanvas unit as a set of base classes
for fpGUI (my custom drawn widget set), what do I need to do, or
implement.  Is there any documentation on that unit.

Take the Font class as an example.  Looking at the TFPCustomFont
class.  I guess I would need to create a descendant class (TFFont in
this case) and then override the abstract methods (in this case
virtual or some reason) for each supported painting backend (GDI, X11)
to create the correct resources.

TFFont = class(TFPCustomFont)
  ..
 protected
   procedure DoAllocateResources; override;
   procedure DoDeAllocateResources; override;
  ..
end;


Am I understanding this correctly?
Is this what the FPCanvas unit is meant for?  Acting as a base class
for an actual implementation?


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal