Sign in Join

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

Mailing lists / lazarus / 2009-12

Cross Compile for arm-linux

39 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Unknown author

Hi all,

I'm a newbie about cross compiling, but I need to develop some applications for arm-linux architecture. There are many days that I search on web tutorials, guide and simple sparse bit of knowledge about how to to... but no references to tutorials I found are very old and partially not working.

So I hope that you can help me to write a generic step by step tutorial, starting from "generic" sources; I mean what to download, what to write in terminal, etc...

What I believe to know is that:
1) cross compiling for arm-linux is simplest from Linux X86
2) I need binutils ( I downloaded latest one:
http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.gz )
3) I need sources of fpc and lazarus. I downloaded:
- latest official fpc: fpcbuild-2.2.4.zip
- Lazarus snapshots: e.g. today's lazarus-0.9.29-22952-20091204-src.tar.bz2

Now knowledge is even more darkness... I tried to install binutils:

cd ~/temp/buinutils
./configure
make
sudo make install

My experience with linux is not very deep, so I don't know if it is installed right.

After this, do I need to compile fpc and than lazarus? How?

I became crazy... I think I will never develop for arm-linux without your step by step help...

Thank you very much in advance!

Reply by email

Henry Vermaak
to Unknown author

2009/12/4 :

Show quoted text 26 lines
Hi all, I'm a newbie about cross compiling, but I need to develop some applications for arm-linux architecture. There are many days that I search on web tutorials, guide and simple sparse bit of knowledge about how to to... but no success at now. All references to tutorials I found are very old and partially not working. So I hope that you can help me to write a generic step by step tutorial, starting from "generic" sources; I mean what to download, what to write in terminal, etc... What I believe to know is that: 1) cross compiling for arm-linux is simplest from Linux X86 2) I need binutils ( I downloaded latest one: http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.gz ) 3) I need sources of fpc and lazarus. I downloaded: ?- latest official fpc: fpcbuild-2.2.4.zip ?- Lazarus snapshots: e.g. today's lazarus-0.9.29-22952-20091204-src.tar.bz2 Now knowledge is even more darkness... I tried to install binutils: cd ~/temp/buinutils ./configure make sudo make install

This will give you the binutils for your architecture and that's probably not what you want. You need to cross compile the binutils first, so you need to make distclean in your binutils directory, then ./configure --target=arm-linux. You probably also want to use --prefix to control where the files get installed (I think /usr/local is the default).

That's just the beginning, though, and if you need to use libc (like with lazarus), you need to cross build that, too.

So, it's a lot easier to get the cross tools for the specific distribution your arm board is using. Some distributions have a "master makefile" that auto automatically build the cross compilers and binutils. If you've bought an arm development kit, the vendor usually supplies this for you. See if you can find this before you attempt to build fpc. Also note what c library your arm system is using (e.g. glibc, uclibc).

Show quoted text 5 lines
My experience with linux is not very deep, so I don't know if it is installed right. After this, do I need to compile fpc and than lazarus? How?

I've used fpc on arm-linux, but never lazarus, since I've never seen an embedded board with gtk libs on. Some of them have qt, though, but ymmv. As far as graphics go, I've managed to use fpgui, since it talks to the x libraries directly and is very light weight.

Henry

Reply by email

Kjow
to Henry Vermaak

2009/12/4 Henry Vermaak :

Show quoted text 6 lines
This will give you the binutils for your architecture and that's probably not what you want. ?You need to cross compile the binutils first, so you need to make distclean in your binutils directory, then ./configure --target=arm-linux. ?You probably also want to use --prefix to control where the files get installed (I think /usr/local is the default).

Ok, thank you!
I tried to do:

make distclean
./configure --target=arm-linux
make

but I get some errors:

~/arm/binutils$ make
make[1]: Entering directory `/home/kjow/arm/binutils' Configuring in ./intl
configure: loading cache ./config.cache
configure: error: `target_alias' has changed since the previous run: configure: former value: `i686-pc-linux-gnu'
configure: current value: `arm-linux'
configure: error: in `/home/kjow/arm/binutils/intl': configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm ./config.cache' and start over make[1]: *** [configure-intl] Error 1
make[1]: Leaving directory `/home/kjow/arm/binutils' make: *** [all] Error 2

Show quoted text 15 lines
That's just the beginning, though, and if you need to use libc (like with lazarus), you need to cross build that, too. So, it's a lot easier to get the cross tools for the specific distribution your arm board is using. ?Some distributions have a "master makefile" that auto automatically build the cross compilers and binutils. ?If you've bought an arm development kit, the vendor usually supplies this for you. ?See if you can find this before you attempt to build fpc. ?Also note what c library your arm system is using (e.g. glibc, uclibc). I've used fpc on arm-linux, but never lazarus, since I've never seen an embedded board with gtk libs on. ?Some of them have qt, though, but ymmv. ?As far as graphics go, I've managed to use fpgui, since it talks to the x libraries directly and is very light weight.

I need to develop for Maemo platform (Nokia N900), it is a GNU/Linux distribution based on Debian (arm) with X11 and all other things of desktop version. There is a specific development kit, but it can run any arm-linux compiled program (I read that in past versions, some people have cross compiled for it)
I would to have a lazarus configured like for arm-wince, so multiplatform will be fantastic!

Thank you!

Reply by email

Florian Klaempfl
to Kjow
Show quoted text 30 lines
2009/12/4 Henry Vermaak : > This will give you the binutils for your architecture and that's > probably not what you want. You need to cross compile the binutils > first, so you need to make distclean in your binutils directory, then > ./configure --target=arm-linux. You probably also want to use > --prefix to control where the files get installed (I think /usr/local > is the default). Ok, thank you! I tried to do: make distclean ./configure --target=arm-linux make but I get some errors: ~/arm/binutils$ make make[1]: Entering directory `/home/kjow/arm/binutils' Configuring in ./intl configure: loading cache ./config.cache configure: error: `target_alias' has changed since the previous run: configure: former value: `i686-pc-linux-gnu' configure: current value: `arm-linux' configure: error: in `/home/kjow/arm/binutils/intl': configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm ./config.cache' and start over make[1]: *** [configure-intl] Error 1 make[1]: Leaving directory `/home/kjow/arm/binutils' make: *** [all] Error 2

The makefiles of GNU binutils are broken: if you compile for another target, distclean is not enough, just delete the whole binutils source dir and unpack it again.

Reply by email

Kjow
to Florian Klaempfl

2009/12/5 Florian Klaempfl :

The makefiles of GNU binutils are broken: if you compile for another target, distclean is not enough, just delete the whole binutils source dir and unpack it again.

Ok, I deleted binutils directory and re-unpacked it, then I did again:

./configure --target=arm-linux
make

It started to make a lot of compilation rows, until these last rows:

o tc-arm.o `test -f 'config/tc-arm.c' || echo './'`config/tc-arm.c cc1: warnings being treated as errors
config/tc-arm.c: In function ?make_mapping_symbol?: config/tc-arm.c:2489: error: suggest braces around empty body in an ?if? statement
make[4]: *** [tc-arm.o] Error 1
make[4]: Leaving directory `/home/kjow/arm/binutils/gas' make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/kjow/arm/binutils/gas' make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kjow/arm/binutils/gas' make[1]: *** [all-gas] Error 2
make[1]: Leaving directory `/home/kjow/arm/binutils' make: *** [all] Error 2

I think that are not very comfortable these errors... what's wrong?

Thank you!

Reply by email

Henry Vermaak
to Kjow

2009/12/5 Kjow :

2009/12/5 Florian Klaempfl : > The makefiles of GNU binutils are broken: if you compile for another > target, distclean is not enough, just delete the whole binutils source > dir and unpack it again.

Odd, it seems to work for me, but I'm on 2.19.

Show quoted text 10 lines
Ok, I deleted binutils directory and re-unpacked it, then I did again: ./configure --target=arm-linux make It started to make a lot of compilation rows, until these last rows: o tc-arm.o `test -f 'config/tc-arm.c' || echo './'`config/tc-arm.c cc1: warnings being treated as errors

Note this.

Show quoted text 12 lines
config/tc-arm.c: In function ?make_mapping_symbol?: config/tc-arm.c:2489: error: suggest braces around empty body in an ?if? statement make[4]: *** [tc-arm.o] Error 1 make[4]: Leaving directory `/home/kjow/arm/binutils/gas' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/kjow/arm/binutils/gas' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/kjow/arm/binutils/gas' make[1]: *** [all-gas] Error 2 make[1]: Leaving directory `/home/kjow/arm/binutils' make: *** [all] Error 2

You can probably fix this with passing --disable-werror to ./configure.

I think that are not very comfortable these errors... what's wrong?

I'm still not sure why you are messing around with binutils. You need to build for maemo, so just download the maemo sdk, read the manual, then try and cross compile fpc and lazarus. Relevant links are:

http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Platforms/Maemo/ http://maemo-sdk.garage.maemo.org/user-guide.html

Henry

Reply by email

Kjow
to Henry Vermaak

2009/12/5 Henry Vermaak :

You can probably fix this with passing --disable-werror to ./configure.

Perfect!

./configure --target=arm-linux --disable-werror
make
sudo make install

and now I have:

/usr/local/bin/arm-linux-as
/usr/local/bin/arm-linux-ld

So, I think that binutils are compiled right!

Show quoted text 6 lines
I'm still not sure why you are messing around with binutils. ?You need to build for maemo, so just download the maemo sdk, read the manual, then try and cross compile fpc and lazarus. ?Relevant links are: http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Platforms/Maemo/ http://maemo-sdk.garage.maemo.org/user-guide.html

Because Maemo runs "pure" arm-linux programs and I know that Lazarus/fpc can compile "pure" arm-linux programs... What I know (docs are very few) is that to compile for arm-linux I need to use binutils that make utilities to generate arm-code... I know that I'm a lot confusing... but docs are very few...

e.g. here: http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM

It starts from arm-linux-fpc and than ARM-binutils, but everything is very old and there isn't any precompiled package (such as arm-wince) so I must do all myself, but there isn't tutorials or explicative/step by step documents...

Thank you!

Reply by email

Henry Vermaak
to Kjow

2009/12/6 Kjow :

Show quoted text 13 lines
2009/12/5 Henry Vermaak : > I'm still not sure why you are messing around with binutils. ?You need > to build for maemo, so just download the maemo sdk, read the manual, > then try and cross compile fpc and lazarus. ?Relevant links are: > > http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Platforms/Maemo/ > http://maemo-sdk.garage.maemo.org/user-guide.html Because Maemo runs "pure" arm-linux programs and I know that Lazarus/fpc can compile "pure" arm-linux programs... What I know (docs are very few) is that to compile for arm-linux I need to use binutils that make utilities to generate arm-code... I know that I'm a lot confusing... but docs are very few...

It's true that fpc does not need any of the gcc tools, but since you want to use lazarus, you'll need cross compiled libs of the widget set and libc. If you use the sdk, you get these for free. The way you are going now, you'll eventually need to cross compile those libraries, too.

Henry

Reply by email

Kjow
to Henry Vermaak

2009/12/6 Henry Vermaak :

Show quoted text 5 lines
It's true that fpc does not need any of the gcc tools, but since you want to use lazarus, you'll need cross compiled libs of the widget set and libc. ?If you use the sdk, you get these for free. ?The way you are going now, you'll eventually need to cross compile those libraries, too.

At moment I don't need particular feature of maemo/N900... I simply need to develop multiplatform applications for arm-linux, arm-wince and possibly a port to x86 platforms, so at now I would to create simplest "hello world" with lazarus targeted on arm-linux/wince. For example, here ( http://talk.maemo.org/showthread.php?t=1846 ) there is a comment that explicate what I would to do (ok, it is only fpc oriented, but step two will be fpc+lazarus). In that thread is mentioned the tutorial I linked at first (
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM )...

So, in first place I would make able fpc to cross compile for generic arm-linux and than "enable" Lazarus to do that.

As you can see, I'm not expert about all this things... for this reason I need step by step help in everything, even worse english is not my main language so I have some difficulties to understand perfectly all suggestions, the sparse informations and outdated guides in the web about cross compiling with lazarus/fpc.

Thank you.

Reply by email

Paul Nicholls
to Unknown author: I'm a newbie about cross compiling, but I need to develop some applications for arm-linux…

Hi :)
I don't know if it will help, but back in 2007, I started a website:

http://fpc4gp2x.eonclash.com/

which allows one to make programs for an arm-linux handheld, the gp2x.

It has a freepascal cross-compiler that works under Windows 32, and generates arm-linux binaries :)

I know it is over 2 years old now, but perhaps it may still help?

cheers,
Paul

Earlier message 51 lines
----- Original Message ----- From: To: "Lazarus Mailing List" Sent: Saturday, December 05, 2009 8:30 AM Subject: [Lazarus] Cross Compile for arm-linux > Hi all, > > I'm a newbie about cross compiling, but I need to develop some > applications for arm-linux architecture. There are many days that I > search on web tutorials, guide and simple sparse bit of knowledge > about how to to... but no success at now. > All references to tutorials I found are very old and partially not > working. > > So I hope that you can help me to write a generic step by step > tutorial, starting from "generic" sources; I mean what to download, > what to write in terminal, etc... > > What I believe to know is that: > 1) cross compiling for arm-linux is simplest from Linux X86 > 2) I need binutils ( I downloaded latest one: > http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.gz ) > 3) I need sources of fpc and lazarus. I downloaded: > - latest official fpc: fpcbuild-2.2.4.zip > - Lazarus snapshots: e.g. today's > lazarus-0.9.29-22952-20091204-src.tar.bz2 > > Now knowledge is even more darkness... I tried to install binutils: > > cd ~/temp/buinutils > ./configure > make > sudo make install > > My experience with linux is not very deep, so I don't know if it is > installed right. > > After this, do I need to compile fpc and than lazarus? How? > > I became crazy... I think I will never develop for arm-linux without > your step by step help... > > Thank you very much in advance! > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Kjow
to Paul Nicholls

2009/12/7 Paul Nicholls :

Show quoted text 11 lines
Hi :) I don't know if it will help, but back in 2007, I started a website: http://fpc4gp2x.eonclash.com/ which allows one to make programs for an arm-linux handheld, the gp2x. It has a freepascal cross-compiler that works under Windows 32, and generates arm-linux binaries :) I know it is over 2 years old now, but perhaps it may still help?

Hi!
Thanks for reply!

I read the site, but I found a pre-compiled "FPC_win32_arm-linux" with all cross compiling files already builded (e.g. ppccrossarm.exe).

I need to know how to build my own "FPC_win32_arm-linux" starting from a generic/latest "fpcscr.zip" :)

e.g. CodeTyphon make it from latest svn/cvs snapshot of fpc and lazarus, but at the linking time, after compile, there is an error with link of X11 (-lX11). I tried to see what their program do to build fpc/lazarus arm-linux compatible, but I can't understand all. CodeTyphon have some hidden procedure (not visible script), so I can view only output commands...

Please, help me to make a generic script/tutorial to make fpc/lazarus arm-linux "compatible"!

Thank you!

Reply by email

Dariusz Mazur
to Kjow
Show quoted text 5 lines
view only output commands... Please, help me to make a generic script/tutorial to make fpc/lazarus arm-linux "compatible"!

I have this script to compile FPC from svn:

make crossinstall CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR=/home/darek2008/fpcarm/arm-linux-uclibc/bin CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O-"
INSTALL_PREFIX=/home/darek2008/fpcarm COMPILER_OPTIONS="cpufpemu"

there are two folders with toolchain
/home/darek2008/fpcarm/arm-linux-uclibc/bin
with: as,ar, ld ....
/home/darek2008/fpcarm/arm-linux-uclibc/lib
with : cprt0.o , libptrhead.so.0 .....

and at last fpc.cfg:

#INCLUDE /etc/fpc.cfg
#DEFINE DEMOTEST
#DEFINE DEMOTEST1
#DEFINE LAZARUS

-Fu~/fpcarm/lib/fpc/2.5.1/units/$fpctarget/*
-Fl~/fpcarm/$fpctarget-uclibc/lib/
-FU/home/darek2008/fpcarm/praca/$fpctarget
-Fu~/lib/synapsesvn/trunk
-Fu/usr/lib/lazarus/lcl
-Fi/usr/lib/lazarus/lcl/include
-Fu/usr/lib/lazarus/lcl/nonwin32

-a
-Sd
-Xd
-Xs

-O-

#IFDEF CPUARM
;-XParm-linux-uclibc-
-XP/home/darek2008/fpcarm/arm-linux-uclibc/bin/
-Xr/home/darek2008/fpcarm/arm-linux-uclibc/lib
-XR/home/darek2008/fpcarm/arm-linux-uclibc/
-darm
-CfSOFT
-CaEABI
-Tlinux

#ENDIF
#IFDEF CPUI386

-XP/home/darek2008/fpcarm/i386-linux-uclibc/bin/
-Xr/home/darek2008/fpcarm/i386-linux-uclibc/lib/
-FL/home/darek2008/fpcarm/i386-linux-uclibc/ld-uClibc.so.0 #ENDIF

Darek

Reply by email

Kjow
to Dariusz Mazur

2009/12/7 Dariusz Mazur :

and at last fpc.cfg:

Thank you very much!

I'm going to try all, but I don't know a thing: the fpc.cfg you posted is to append to existing one or it is a replace? I'm not expert to config fpc...

Reply by email

Dariusz Mazur
to Kjow

Kjow pisze:

Show quoted text 11 lines
2009/12/7 Dariusz Mazur : > and at last fpc.cfg: > Thank you very much! I'm going to try all, but I don't know a thing: the fpc.cfg you posted is to append to existing one or it is a replace? I'm not expert to config fpc...

this is fpc.cfg in the same dir as you compile,
as you see it include default fpc

Darek

Reply by email

Kjow
to Dariusz Mazur

2009/12/7 Dariusz Mazur :

this is fpc.cfg in the same dir as you compile, as you see it include default fpc

Thank you very much!
I understand better now :)

in your fpc.cfg there are these rows:

-FU/home/darek2008/fpcarm/praca/$fpctarget
-Fu~/lib/synapsesvn/trunk

what's "praca"?
synapse works well on arm-linux? do you know about lnet?

Thanks!

Reply by email

Dariusz Mazur
to Kjow

Kjow pisze:

Show quoted text 16 lines
2009/12/7 Dariusz Mazur : > this is fpc.cfg in the same dir as you compile, > as you see it include default fpc > Thank you very much! I understand better now :) in your fpc.cfg there are these rows: -FU/home/darek2008/fpcarm/praca/$fpctarget -Fu~/lib/synapsesvn/trunk what's "praca"?

name of work directory

synapse works well on arm-linux?

yes

do you know about lnet?

I don't know

Darek

Reply by email

Kjow
to Dariusz Mazur

Now I have this problem:

/home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm -XParm-linux- /home/kjow/Programmazione/TestARM/prova1.pas

Free Pascal Compiler version 2.5.1 [2009/12/07] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling /home/kjow/Programmazione/TestARM/prova1.pas Assembling hello
Linking /home/kjow/Programmazione/TestARM/prova1
/usr/local/bin/arm-linux-ld: cannot open linker script file link.res: No such file or directory
prova1.pas(3,21) Error: Error while linking
prova1.pas(3,21) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

what's link.res? Where can I find it? (Or, how do I create it?)

Thanks!

Reply by email

Kjow
to Kjow

PS prova1.pas

cat /home/kjow/Programmazione/TestARM/prova1.pas

program hello;
 begin
   writeln ('Hello!');
 end.

2009/12/9 Kjow :

Show quoted text 21 lines
Now I have this problem: /home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm -XParm-linux- /home/kjow/Programmazione/TestARM/prova1.pas Free Pascal Compiler version 2.5.1 [2009/12/07] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling /home/kjow/Programmazione/TestARM/prova1.pas Assembling hello Linking /home/kjow/Programmazione/TestARM/prova1 /usr/local/bin/arm-linux-ld: cannot open linker script file link.res: No such file or directory prova1.pas(3,21) Error: Error while linking prova1.pas(3,21) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted what's link.res? Where can I find it? (Or, how do I create it?) Thanks!

Reply by email

Dariusz Mazur
to Kjow: Now I have this problem: /home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm -XParm-linux-…

Kjow pisze:

Show quoted text 5 lines
Now I have this problem: /home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm -XParm-linux- /home/kjow/Programmazione/TestARM/prova1.pas
try

/home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm -XParm-linux- prova1.pas

which is curr dir?
have You write access to TestARM ?

Show quoted text 14 lines
Free Pascal Compiler version 2.5.1 [2009/12/07] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling /home/kjow/Programmazione/TestARM/prova1.pas Assembling hello Linking /home/kjow/Programmazione/TestARM/prova1 /usr/local/bin/arm-linux-ld: cannot open linker script file link.res: No such file or directory prova1.pas(3,21) Error: Error while linking prova1.pas(3,21) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted what's link.res? Where can I find it? (Or, how do I create it?)

the same dir where You compile

Darek

Reply by email

Kjow
to Dariusz Mazur

2009/12/9 Dariusz Mazur :

Show quoted text 8 lines
try /home/kjow/fpcarm/lib/fpc/2.5.1/ppcrossarm ?-XParm-linux- ? prova1.pas which is curr dir? have You write access to TestARM ? the same dir where You compile

Ok, probably this is the mistake. Thank you!
I was trying to compile from fpcscr (current dir) where I had not root access (I didn't know that it save file in current dir, I thought that it save in destination dir).
In few hours I think I can try, I had to reinstall my ubuntu 9.10 (fortunately it is a vm) and recompile fpc/lazarus from sources...

Reply by email

Kjow
to Unknown author: I'm a newbie about cross compiling, but I need to develop some applications for arm-linux…

Hi again,

I re-compiled all (fpc+lazarus+binutils) on a fresh Ubuntu 9.10 x86 VM (virtualbox) and it seems to be ok.

Lazarus compile x86 code.

Now I'm trying again to make fpc/lazarus compatible with arm, but there are other problems.

I compiled the ppcrossarm:
~$ ~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/ppcrossarm -iV 2.5.1

But when I try to compile a simple "TestARM.pas" program:

~/TestARM$ cat TestARM.pas
program hello;
 begin
   writeln ('Hello!');
 end.

I get this error:

~/TestARM$ ~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/ppcrossarm -XParm-linux- TestARM.pas
Free Pascal Compiler version 2.5.1 [2009/12/09] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling TestARM.pas
Fatal: Can't find unit system used by hello
Fatal: Compilation aborted

Some suggestions?

Furthermore, if I set in Lazarus->Project->Compiler Options->Code:

Target OS (-T): Linux
Target CPU family (-P): arm

There is this error:

"The project uses target OS=Error: ppcarm can't be executed, error message: Failed to execute "ppcarm", error code: 127. The system.ppu for this target was not found in the FPC binary directories. Make sure fpc is installed correctly for this target and fpc.cfg contains the right directories."

this is the fpc in my fpc dir (~/lazarus/fpc/2.5.1/fpc.cfg or the symlinked /usr/share/fpcsrc/fpc.cfg ):

~$ cat /usr/share/fpcsrc/fpc.cfg
#INCLUDE /etc/fpc.cfg
#DEFINE DEMOTEST
#DEFINE DEMOTEST1
#DEFINE LAZARUS

-Fu~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/units/$fpctarget/* -Fl~/lazarus/fpc/2.5.1/rtl/units/$fpctarget/
-Fu~/lazarus/lcl
-Fi~/lazarus/lcl/include
-Fu~/lazarus/lcl/nonwin32

-a
-Sd
-Xd
-Xs

-O-

#IFDEF CPUARM
;-XParm-linux-uclibc-
-XP~/lazarus/fpc/binutils/
-Xr~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/units/$fpctarget/rtl/ -XR~/lazarus/fpc/
-darm
-CfSOFT
-CaEABI
-Tlinux

#ENDIF
#IFDEF CPUI386

-XP~/lazarus/fpc/binutils/
-Xr~/lazarus/fpc/2.5.1/rtl/units/$fpctarget/
-FL~/lazarus/fpc/ld-uClibc.so.0
#ENDIF

Thank you!

Reply by email

Kjow
to Kjow

It works!!!

My Nokia N900 says its first console word: "Hello!" :D

With

~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/ppcrossarm -va

I saw that fpc didn't load "arm fpc.cfg" so I saved it to ~/.fpc.cfg and than I had to adjust a couple of path on it. After that I launched:

~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/ppcrossarm -Xd -CaEABI -CfSOFT -CpARMV5 TestARM.pas

Free Pascal Compiler version 2.5.1 [2009/12/09] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling TestARM.pas
Assembling hello
Linking TestARM
4 lines compiled, 0.4 sec

I copied "TestARM" on device in /opt/mydir/
then chmod +x TestARM

./TestARM

Hello!

:D

Thank you all!

About Lazarus, same thing as before, I don't have in my system ppcarm... I need to symlink ppcrossarm somewhere?

Reply by email

Kjow

Hi all,
I'm writing a tutorial to cross compile for arm-linux, but there are some problems yet.
Here first revision:
http://forum.lazarus.freepascal.org/index.php/topic,8084.0.html

I don't know if all steps are right, infact FPC compile simplest code and my arm-linux device runs that, but I can't get Lazarus cross compiling... it returns: "/tmp/project1.lpr(1,1) Fatal: Can't find unit system used by Project1"

For command line FPC compiling I tried more complex program, with other units than default, but it give error. I tried the example program linked here:
http://lists.lazarus.freepascal.org/pipermail/lazarus/2009-December/047424.html Precisely this: http://fpc4gp2x.eonclash.com/downloads/gp2x_tutorial.7z

This is the console output:

~/programmazione/gp2xdemo$
~/lazarus/fpc/2.5.1/lib/fpc/2.5.1/ppcrossarm -Xd -CaEABI -CfSOFT -CpARMV5 gp2x_tutorial.dpr
Free Pascal Compiler version 2.5.1 [2009/12/09] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling gp2x_tutorial.dpr
Assembling gp2x_tutorial
Linking gp2x_tutorial
/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/home/kjow/lazarus/fpc/binutils/ld: cannot find -lSDL gp2x_tutorial.dpr(137,45) Error: Error while linking gp2x_tutorial.dpr(137,45) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

Here files in gp2xdemo:
backup gp2x_tutorial.dpr gp2x_tutorial.o SDL.o CleanupFiles.bat gp2x_tutorial.~dpr image.bmp SDL.pas CompileAux.bat gp2x_tutorial.dsk InitFiles.bat SDL.~pas CompileMain.bat gp2x_tutorial.~dsk jedi-sdl.inc SDL.ppu CompileProject.bat gp2x_tutorial.dsm link.res SDL.s gp2x_tutorial.cfg gp2x_tutorial.exe pgd.bmp gp2x_tutorial.compiled gp2x_tutorial.gpe SDL.dcu gp2x_tutorial.dof gp2x_tutorial.lpi SDL.dll

Thank you!

Reply by email

Kjow
to Kjow

Hi again,

I'm tring to compile from lazarus a simple form with a button for gtk2 arm-linux...

In lazarus I get this error:

...
Recompiling WSLCLClasses, checksum changed for LCLProc wslclclasses.pp(32,56) Fatal: Can't find unit WSLCLClasses used by LCLClasses

FPC seems to works ok from console with a simple "hello world" (only a "writlen" in it):

~/dev/TestARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 TestARM.pas Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling TestARM.pas
Assembling hello
Linking TestARM
4 lines compiled, 0.1 sec

But, from console, the same lazarus project returns:

~/dev/TestARM/LazARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted

Can you help me?
Thank you!

Kjow

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 36 lines
Hi again, I'm tring to compile from lazarus a simple form with a button for gtk2 arm-linux... In lazarus I get this error: ... Recompiling WSLCLClasses, checksum changed for LCLProc wslclclasses.pp(32,56) Fatal: Can't find unit WSLCLClasses used by LCLClasses FPC seems to works ok from console with a simple "hello world" (only a "writlen" in it): ~/dev/TestARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 TestARM.pas Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling TestARM.pas Assembling hello Linking TestARM 4 lines compiled, 0.1 sec But, from console, the same lazarus project returns: ~/dev/TestARM/LazARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling LAzARM.lpr Fatal: Can't find unit Interfaces used by LAzARM Fatal: Compilation aborted Can you help me?

You forgot the -Fu option.
Have you compiled the LCL for arm?

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/11 Mattias Gaertner :

You forgot the -Fu option.

Which path I need to use?
I have lazarus (source/bin) in /home/kjow/lazarus/

Have you compiled the LCL for arm?

I tried with:

make lcl LCL_PLATFORM=gtk2 CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/
FPC=/usr/lib/fpc/2.5.1/ppcrossarm OPT="-CfSOFT -Xd -Sd"

...
...
Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling interfaces.pas
Assembling interfaces
43 lines compiled, 0.2 sec
make[3]: Leaving directory `/home/kjow/lazarus/lcl/interfaces/gtk2' make[2]: Leaving directory `/home/kjow/lazarus/lcl/interfaces' make[1]: Leaving directory `/home/kjow/lazarus/lcl'

But I don't know if it is right.

Thank you very much!

Reply by email

Kjow
to Kjow

2009/12/11 Kjow :

Show quoted text 5 lines
I tried with: make lcl LCL_PLATFORM=gtk2 CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ FPC=/usr/lib/fpc/2.5.1/ppcrossarm OPT="-CfSOFT -Xd -Sd"

I tried also, in lazarus root, but:

~/lazarus/$ sudo make clean all CPU_TARGET=arm OS_TARGET=linux PP=/usr/local/bin/ppcarm OPT="-FU/usr/lib/fpc/2.5.1/units/arm-linux/" ...
Target OS: Linux for ARM
Compiling lazarus.pp
Assembling lazarus
Linking ../lazarus
/usr/local/bin/arm-linux-ld: cannot find -lX11
lazarus.pp(125,42) Error: Error while linking
lazarus.pp(125,42) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[2]: *** [lazarus] Error 1
make[2]: Leaving directory `/home/kjow/lazarus/ide' make[1]: *** [ide] Error 2
make[1]: Leaving directory `/home/kjow/lazarus/ide' make: *** [ide] Error 2

~/lazarus$ make lcl LCL_PLATFORM=GTK2 PP=ppcarm CPU_TARGET=arm OS_TARGET=linux make -C lcl all
make[1]: Entering directory `/home/kjow/lazarus/lcl' /bin/rm -f units/arm-linux/alllclunits.ppu
ppcarm -Parm -XParm-linux- -Xr -gl -Fu. -Funonwin32 -Fuforms -Fuwidgetset -Fu/usr/lib/fpc/2.5.1/units/arm-linux/rtl -Fiinclude -FE. -FUunits/arm-linux -darm alllclunits.pp
Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling alllclunits.pp
Assembling alllclunits
73 lines compiled, 0.2 sec
make -C interfaces all
make[2]: Entering directory `/home/kjow/lazarus/lcl/interfaces' make[2]: *** No rule to make target `GTK2_all', needed by `all'. Stop. make[2]: Leaving directory `/home/kjow/lazarus/lcl/interfaces' make[1]: *** [interfaces] Error 2
make[1]: Leaving directory `/home/kjow/lazarus/lcl' make: *** [lcl] Error 2

cd /packager/registration
~/lazarus/packager/registration$ make PP=ppcarm CPU_TARGET=arm OS_TARGET=linux /bin/rm -f ../units/arm-linux/lazaruspackageintf.ppu ppcarm -Parm -XParm-linux- -Xr -gl -Fu.
-Fu/usr/lib/fpc/2.5.1/units/arm-linux/rtl -FE. -FU../units/arm-linux -darm lazaruspackageintf.pas
Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling lazaruspackageintf.pas
Assembling lazaruspackageintf
109 lines compiled, 0.0 sec

But now compiling with command line:

~/dev/TestARM/LazARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted
kjow at kjw-linux-vm:~/dev/TestARM/LazARM$ ppcarm -Xd -CaEABI -CfSOFT -CpARMV5 LAzARM.lpr
Free Pascal Compiler version 2.5.1 [2009/12/11] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Compiling /home/kjow/lazarus/lcl/interfacebase.pp
Compiling /home/kjow/lazarus/lcl/lclstrconsts.pas
Writing Resource String Table file: lclstrconsts.rst Assembling lclstrconsts
Compiling /home/kjow/lazarus/lcl/lcltype.pp
Assembling lcltype
Compiling /home/kjow/lazarus/lcl/lclproc.pas
Compiling /home/kjow/lazarus/lcl/fpcadds.pas
Assembling fpcadds
Compiling /home/kjow/lazarus/lcl/avglvltree.pas
Assembling avglvltree
Compiling /home/kjow/lazarus/lcl/fileutil.pas
Compiling /home/kjow/lazarus/lcl/masks.pas
Assembling masks
Assembling fileutil
Assembling lclproc
Compiling /home/kjow/lazarus/lcl/lmessages.pp
Compiling /home/kjow/lazarus/lcl/graphtype.pp
Assembling graphtype
Assembling lmessages
Compiling /home/kjow/lazarus/lcl/graphmath.pp
Assembling graphmath
Compiling /home/kjow/lazarus/lcl/themes.pas
Compiling /home/kjow/lazarus/lcl/tmschema.pas
Assembling tmschema
Compiling /home/kjow/lazarus/lcl/interfacebase.pp
Assembling interfacebase
Compiling /home/kjow/lazarus/lcl/lclintf.pas
Compiling /home/kjow/lazarus/lcl/lresources.pp
Compiling /home/kjow/lazarus/lcl/dynqueue.pas
Assembling dynqueue
Compiling /home/kjow/lazarus/lcl/lazconfigstorage.pas Assembling lazconfigstorage
Assembling lresources
Compiling /home/kjow/lazarus/lcl/utf8process.pp
Assembling utf8process
Assembling lclintf
Compiling /home/kjow/lazarus/lcl/graphics.pp
Compiling /home/kjow/lazarus/lcl/intfgraphics.pas
Compiling /home/kjow/lazarus/lcl/icnstypes.pas
Assembling icnstypes
Compiling /home/kjow/lazarus/lcl/graphics.pp
Compiling /home/kjow/lazarus/lcl/lclrescache.pas
Assembling lclrescache
Assembling graphics
Assembling intfgraphics
Compiling /home/kjow/lazarus/lcl/imglist.pp
Compiling /home/kjow/lazarus/lcl/lclclasses.pp
Compiling /home/kjow/lazarus/lcl/lclclasses.pp
Assembling lclclasses
Compiling /home/kjow/lazarus/lcl/controls.pp
Compiling /home/kjow/lazarus/lcl/utrace.pp
Assembling utrace
Compiling /home/kjow/lazarus/lcl/propertystorage.pas Assembling propertystorage
Compiling /home/kjow/lazarus/lcl/menus.pp
Compiling /home/kjow/lazarus/lcl/actnlist.pas
Assembling actnlist
Compiling /home/kjow/lazarus/lcl/forms.pp
Compiling /home/kjow/lazarus/lcl/maps.pp
Assembling maps
Compiling /home/kjow/lazarus/lcl/lclversion.pas
Assembling lclversion
Compiling /home/kjow/lazarus/lcl/customtimer.pas
Assembling customtimer
Compiling /home/kjow/lazarus/lcl/clipbrd.pp
Assembling clipbrd
Compiling /home/kjow/lazarus/lcl/helpintfs.pas
Assembling helpintfs
Compiling /home/kjow/lazarus/lcl/controls.pp
Compiling /home/kjow/lazarus/lcl/forms.pp
Assembling forms
Assembling controls
Assembling menus
Assembling imglist
Assembling themes
Compiling /home/kjow/lazarus/lcl/stdctrls.pp
Compiling /home/kjow/lazarus/lcl/extendedstrings.pas Assembling extendedstrings
Compiling /home/kjow/lazarus/lcl/textstrings.pas
Assembling textstrings
Assembling stdctrls
Compiling /home/kjow/lazarus/lcl/lclmessageglue.pas Assembling lclmessageglue
Compiling /home/kjow/lazarus/lcl/dynhasharray.pp
Assembling dynhasharray
Compiling /home/kjow/lazarus/lcl/comctrls.pp
Compiling /home/kjow/lazarus/lcl/extctrls.pp
Compiling /home/kjow/lazarus/lcl/popupnotifier.pas Assembling popupnotifier
Assembling extctrls
Compiling /home/kjow/lazarus/lcl/toolwin.pp
Assembling toolwin
Compiling /home/kjow/lazarus/lcl/buttons.pp
Compiling /home/kjow/lazarus/lcl/imagelistcache.pas Assembling imagelistcache
Assembling buttons
Assembling comctrls
Compiling /home/kjow/lazarus/lcl/dialogs.pp
Compiling /home/kjow/lazarus/lcl/buttonpanel.pas
Assembling buttonpanel
Assembling dialogs
Compiling /home/kjow/lazarus/lcl/extdlgs.pas
Compiling /home/kjow/lazarus/lcl/calendar.pp
Assembling calendar
Assembling extdlgs
Compiling /home/kjow/lazarus/lcl/lclmemmanager.pas Assembling lclmemmanager
Compiling /home/kjow/lazarus/lcl/translations.pas
Compiling /home/kjow/lazarus/lcl/stringhashlist.pas Assembling stringhashlist
Compiling /home/kjow/lazarus/lcl/lconvencoding.pas Assembling lconvencoding
Assembling translations
Compiling /home/kjow/lazarus/lcl/lazlinkedlist.pas Assembling lazlinkedlist
Compiling /home/kjow/lazarus/lcl/arrow.pp
Assembling arrow
Compiling /home/kjow/lazarus/lcl/checklst.pas
Assembling checklst
Compiling /home/kjow/lazarus/lcl/grids.pas
Compiling /home/kjow/lazarus/lcl/dynamicarray.pas
Assembling dynamicarray
Compiling /home/kjow/lazarus/lcl/maskedit.pp
Assembling maskedit
Assembling grids
Compiling /home/kjow/lazarus/lcl/pairsplitter.pas
Assembling pairsplitter
Compiling /home/kjow/lazarus/lcl/spin.pp
Assembling spin
Compiling /home/kjow/lazarus/lcl/filectrl.pp
Compiling /home/kjow/lazarus/lcl/shellctrls.pas
Assembling shellctrls
Assembling filectrl
Compiling main.pas
Assembling main
Assembling lazarm
Linking LAzARM
/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/kjow/lazarus/fpc/binutils/ld: cannot find -lX11 LAzARM.lpr(22) Error: Error while linking
LAzARM.lpr(22) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

I have all libraries incompatible... how make it compatible? (or where to find these...)

Thanks

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 12 lines
2009/12/11 Kjow : > I tried with: > > make lcl LCL_PLATFORM=gtk2 CPU_TARGET=arm OS_TARGET=linux > CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ > FPC=/usr/lib/fpc/2.5.1/ppcrossarm OPT="-CfSOFT -Xd -Sd" I tried also, in lazarus root, but: ~/lazarus/$ sudo make clean all CPU_TARGET=arm OS_TARGET=linux PP=/usr/local/bin/ppcarm OPT="-FU/usr/lib/fpc/2.5.1/units/arm-linux/"

This puts all ppu files to /usr/lib/fpc/2.5.1/units/arm-linux/. Normally every project/package has it's own directory for its ppu files. But now you have mixed them all up, which means all documentation don't work for you. You can proceed if you know what you are doing, or remove all files in this directory and restart.

Show quoted text 7 lines
... Target OS: Linux for ARM Compiling lazarus.pp Assembling lazarus Linking ../lazarus /usr/local/bin/arm-linux-ld: cannot find -lX11 lazarus.pp(125,42) Error: Error while linking

You forgot to install the X11 libraries for arm.
LCL applications also needs the gtk2 libraries.

Show quoted text 10 lines
lazarus.pp(125,42) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [lazarus] Error 1 make[2]: Leaving directory `/home/kjow/lazarus/ide' make[1]: *** [ide] Error 2 make[1]: Leaving directory `/home/kjow/lazarus/ide' make: *** [ide] Error 2 ~/lazarus$ make lcl LCL_PLATFORM=GTK2 PP=ppcarm CPU_TARGET=arm OS_TARGET=linux make -C lcl all

The gtk2 must be written small (LCL_PLATFORM=gtk2).

You should have done in the first place instead of the above with the -FU option.
But since you have already compiled the lcl and put its ppu files into a global directory you are out of luck.

Show quoted text 6 lines
[...] But now compiling with command line: [...] I have all libraries incompatible... how make it compatible? (or where to find these...)

I don't know.

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/12 Mattias Gaertner :

Show quoted text 8 lines
> ~/lazarus/$ sudo make clean all CPU_TARGET=arm OS_TARGET=linux > PP=/usr/local/bin/ppcarm OPT="-FU/usr/lib/fpc/2.5.1/units/arm-linux/" This puts all ppu files to /usr/lib/fpc/2.5.1/units/arm-linux/. Normally every project/package has it's own directory for its ppu files. But now you have mixed them all up, which means all documentation don't work for you. You can proceed if you know what you are doing, or remove all files in this directory and restart.

Ummm... sincerely I don't know very well what I'm doing... there are very few examples in web, so I tried some things that I find in similar threads.
However ok, I'm going to remove and re-unpack all sources, but what is the command I need to do to preserve "every project/package in its own directory for its ppu files"?

You forgot to install the X11 libraries for arm. LCL applications also needs the gtk2 libraries.

Umm... I can't find in synaptic/repository/other (maybe, do I need to compile by fpc?)... now I'm trying to grab these libs from my arm device.

Show quoted text 6 lines
The gtk2 must be written small (LCL_PLATFORM=gtk2). You should have done in the first place instead of the above with the -FU option. But since you have already compiled the lcl and put its ppu files into a global directory you are out of luck.

So, in a new/clear installation, after I have FPC that cross compile for arm-linux and before to compile first time Lazarus from sources, what do I need to do?

What I understand:

1) Compile Lazarus for the host.
2) /lazarus$ make lcl LCL_PLATFORM=gtk2 PP=ppcarm CPU_TARGET=arm OS_TARGET=linux
3) /lazarus/packager/registration/$ make PP=ppcarm CPU_TARGET=arm OS_TARGET=linux
4) ?

Thank you!

Kjow

PS I'm sorry if I don't understand, but I find just few examples in how to use these commands...

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 13 lines
2009/12/12 Mattias Gaertner : >> ~/lazarus/$ sudo make clean all CPU_TARGET=arm OS_TARGET=linux >> PP=/usr/local/bin/ppcarm OPT="-FU/usr/lib/fpc/2.5.1/units/arm-linux/" > > This puts all ppu files to /usr/lib/fpc/2.5.1/units/arm-linux/. > Normally every project/package has it's own directory for its ppu > files. But now you have mixed them all up, which means all > documentation don't work for you. You can proceed if you know what you > are doing, or remove all files in this directory and restart. Ummm... sincerely I don't know very well what I'm doing... there are very few examples in web, so I tried some things that I find in similar threads.

The linux arm support for FPC is quite new.

However ok, I'm going to remove and re-unpack all sources, but what is the command I need to do to preserve "every project/package in its own directory for its ppu files"?

This is automatically done by the IDE.
Just start the IDE in a terminal, compile a package normally and see what it does.

I wrote a few hints here:
http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL

Show quoted text 6 lines
> You forgot to install the X11 libraries for arm. > LCL applications also needs the gtk2 libraries. Umm... I can't find in synaptic/repository/other (maybe, do I need to compile by fpc?)... now I'm trying to grab these libs from my arm device.

No. gtk2 and X11 are written in C.
So if there are no cross compiled packages for arm, you may have to cross compile them yourself. See the gtk website of how to do that.

Show quoted text 14 lines
> The gtk2 must be written small (LCL_PLATFORM=gtk2). > > You should have done in the first place instead of the above with > the -FU option. > But since you have already compiled the lcl and put its ppu files > into a global directory you are out of luck. So, in a new/clear installation, after I have FPC that cross compile for arm-linux and before to compile first time Lazarus from sources, what do I need to do? What I understand: 1) Compile Lazarus for the host.

Lazarus is the IDE, LCL and a bunch of components. You only need the LCL and a few components.

2) /lazarus$ make lcl LCL_PLATFORM=gtk2 PP=ppcarm CPU_TARGET=arm OS_TARGET=linux 3) /lazarus/packager/registration/$ make PP=ppcarm CPU_TARGET=arm OS_TARGET=linux

Yes.
You can do that via the IDE.

4) ?

Install the cross compiled libraries for arm. I never did that so I can't give any hints here.

PS I'm sorry if I don't understand, but I find just few examples in how to use these commands...

Cross compiling is an advanced topic.

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/12 Mattias Gaertner :

Thank you very much, Mattias. You are very gentle.

Show quoted text 6 lines
This is automatically done by the IDE. Just start the IDE in a terminal, compile a package normally and see what it does. I wrote a few hints here: http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL

Well, FPC compile right for my device:

Nokia-N900-42-11:/home/opt/KjowProject/Test01# ./test DATE 2009/12/12
FPCTARGET arm
FPCTARGETCPU arm
FPCTARGETOS Linux
FPCVERSION 2.5.1
Nokia-N900-42-11:/home/opt/KjowProject/Test01#

But Lazarus Projects still have some problems. I'm restarted from a new fresh ubuntu installation, so I reinstalled fpc, binutils (both from latest source snaphot) and enabled fpc to cross compile for arm-linux. All ok.
Then compiled Lazarus with classic: ~/lazarus$ make clean all All ok.
Then I followed you wiki-instructions and compiled LCL+Package registration from Lazarus IDE. All OK.

I tried to build a simple form, but I got this error:

...
...
intfgraphics.pas(609,45) Hint: Parameter "Img" not used intfgraphics.pas(653,19) Hint: Local type "PFPColorBytes" is not used intfgraphics.pas(34,70) Hint: Unit "FPCAdds" not used in IntfGraphics Assembling intfgraphics
Compiling /home/kjow/lazarus/lcl/imglist.pp
Compiling /home/kjow/lazarus/lcl/lclclasses.pp
PPU Loading /home/kjow/lazarus/lcl/units/arm-linux/wslclclasses.ppu PPU Source: wslclclasses.pp not found
Recompiling WSLCLClasses, checksum changed for LCLProc wslclclasses.pp(32,56) Fatal: Can't find unit WSLCLClasses used by LCLClasses GetMsgLineFilename Filename
"/home/kjow/dev/TestARM/LazARM/wslclclasses.pp" not found.

Trying by console, I get:

~/dev/TestARM/LazARM$ fpc -Tlinux -Parm LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

Where am I in wrong?

Install the cross compiled libraries for arm. I never did that so I can't give any hints here.

Ok, thank you! I'll try to find it/grab from device.

Thank you very much for support!

Kjow

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 43 lines
2009/12/12 Mattias Gaertner : Thank you very much, Mattias. You are very gentle. > This is automatically done by the IDE. > Just start the IDE in a terminal, compile a package normally and see > what it does. > > I wrote a few hints here: > http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL Well, FPC compile right for my device: Nokia-N900-42-11:/home/opt/KjowProject/Test01# ./test DATE 2009/12/12 FPCTARGET arm FPCTARGETCPU arm FPCTARGETOS Linux FPCVERSION 2.5.1 Nokia-N900-42-11:/home/opt/KjowProject/Test01# But Lazarus Projects still have some problems. I'm restarted from a new fresh ubuntu installation, so I reinstalled fpc, binutils (both from latest source snaphot) and enabled fpc to cross compile for arm-linux. All ok. Then compiled Lazarus with classic: ~/lazarus$ make clean all All ok. Then I followed you wiki-instructions and compiled LCL+Package registration from Lazarus IDE. All OK. I tried to build a simple form, but I got this error: ... ... intfgraphics.pas(609,45) Hint: Parameter "Img" not used intfgraphics.pas(653,19) Hint: Local type "PFPColorBytes" is not used intfgraphics.pas(34,70) Hint: Unit "FPCAdds" not used in IntfGraphics Assembling intfgraphics Compiling /home/kjow/lazarus/lcl/imglist.pp Compiling /home/kjow/lazarus/lcl/lclclasses.pp PPU Loading /home/kjow/lazarus/lcl/units/arm-linux/wslclclasses.ppu PPU Source: wslclclasses.pp not found Recompiling WSLCLClasses, checksum changed for LCLProc

Probably you have somewhere an old ppu from your former experiments in the search path. Add options -vu -vt to find out where it is.

Show quoted text 11 lines
~/dev/TestARM/LazARM$ fpc -Tlinux -Parm LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling LAzARM.lpr Fatal: Can't find unit Interfaces used by LAzARM Fatal: Compilation aborted Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled) Where am I in wrong?

Open the IDE compiler options. You can see that the IDE passes some -Fu and other options. Simply copy those options if you want to compile at the command line.

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/12 Mattias Gaertner :

Probably you have somewhere an old ppu from your former experiments in the search path. Add options -vu -vt to find out where it is.

No, I don't have any old ppu. I restarted from a fresh ubuntu installation (it is a virtual machine, so I just overwrite the hard disk image).
But I don't know where to put -vu -vt options in Lazarus IDE... I tried in Project->Compiler Options->Compilation->Show Options and added to the end.

See below for:
1) Lazarus IDE compiling errors
2) command line compiling errors

Open the IDE compiler options. You can see that the IDE passes some -Fu and other options. Simply copy those options if you want to compile at the command line.

Do you mean these Project->Compiler Options->Compilation->Show Options ?

Thank You!

Kjow

1) Lazarus IDE compiling errors

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Compiling /home/kjow/lazarus/lcl/interfacebase.pp
Compiling /home/kjow/lazarus/lcl/lclstrconsts.pas
Writing Resource String Table file: lclstrconsts.rst Assembling lclstrconsts
Compiling /home/kjow/lazarus/lcl/lcltype.pp
/home/kjow/lazarus/lcl/lcltype.pp(98,18) Hint: Type "HGLOBAL" redefinition Assembling lcltype
Compiling /home/kjow/lazarus/lcl/lclproc.pas
Compiling /home/kjow/lazarus/lcl/fpcadds.pas
Assembling fpcadds
Compiling /home/kjow/lazarus/lcl/avglvltree.pas
Assembling avglvltree
Compiling /home/kjow/lazarus/lcl/fileutil.pas
Compiling /home/kjow/lazarus/lcl/masks.pas
Assembling masks
/home/kjow/lazarus/lcl/include/fileutil.inc(844,37) Hint: Local variable "st" does not seem to be initialized
/home/kjow/lazarus/lcl/include/fileutil.inc(890,32) Hint: Local variable "info" does not seem to be initialized
/home/kjow/lazarus/lcl/include/fileutil.inc(1058,34) Hint: Local variable "Info" does not seem to be initialized
Assembling fileutil
/home/kjow/lazarus/lcl/lclproc.pas(1122,33) Hint: Parameter "ShortCut" not used /home/kjow/lazarus/lcl/lclproc.pas(2330,18) Hint: Conversion between ordinals and pointers is not portable
/home/kjow/lazarus/lcl/lclproc.pas(34,51) Hint: Unit "FPCAdds" not used in LCLProc
Assembling lclproc
Compiling /home/kjow/lazarus/lcl/lmessages.pp
Compiling /home/kjow/lazarus/lcl/graphtype.pp
/home/kjow/lazarus/lcl/graphtype.pp(493,41) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
/home/kjow/lazarus/lcl/graphtype.pp(541,37) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
/home/kjow/lazarus/lcl/graphtype.pp(1409,18) Hint: Local variable "R" does not seem to be initialized
/home/kjow/lazarus/lcl/graphtype.pp(32,10) Hint: Unit "FPCAdds" not used in GraphType
Assembling graphtype
/home/kjow/lazarus/lcl/lmessages.pp(530,16) Hint: Type "PWindowPos" redefinition /home/kjow/lazarus/lcl/lmessages.pp(531,18) Hint: Type "tagWINDOWPOS" redefinition
/home/kjow/lazarus/lcl/lmessages.pp(540,16) Hint: Type "TWindowPos" redefinition /home/kjow/lazarus/lcl/lmessages.pp(541,15) Hint: Type "WINDOWPOS" redefinition Assembling lmessages
Compiling /home/kjow/lazarus/lcl/graphmath.pp
/home/kjow/lazarus/lcl/graphmath.pp(47,12) Hint: Type "PPoint" redefinition /home/kjow/lazarus/lcl/graphmath.pp(521,31) Hint: Local variable "Right" does not seem to be initialized
/home/kjow/lazarus/lcl/graphmath.pp(521,25) Hint: Local variable "Left" does not seem to be initialized
/home/kjow/lazarus/lcl/graphmath.pp(581,62) Hint: Local variable "B" does not seem to be initialized
Assembling graphmath
Compiling /home/kjow/lazarus/lcl/themes.pas
Compiling /home/kjow/lazarus/lcl/tmschema.pas
Assembling tmschema
Compiling /home/kjow/lazarus/lcl/interfacebase.pp
/home/kjow/lazarus/lcl/interfacebase.pp(101,32) Hint: Parameter "Small" not used /home/kjow/lazarus/lcl/interfacebase.pp(101,39) Hint: Parameter "Big" not used ...
/home/kjow/lazarus/lcl/intfgraphics.pas(609,45) Hint: Parameter "Img" not used /home/kjow/lazarus/lcl/intfgraphics.pas(653,19) Hint: Local type "PFPColorBytes" is not used
/home/kjow/lazarus/lcl/intfgraphics.pas(34,70) Hint: Unit "FPCAdds" not used in IntfGraphics
Assembling intfgraphics
Compiling /home/kjow/lazarus/lcl/imglist.pp
Compiling /home/kjow/lazarus/lcl/lclclasses.pp
PPU Loading /home/kjow/lazarus/lcl/units/arm-linux/wslclclasses.ppu PPU Source: wslclclasses.pp not found
Recompiling WSLCLClasses, checksum changed for LCLProc wslclclasses.pp(32,56) Fatal: Can't find unit WSLCLClasses used by LCLClasses

2) command line compiling errors

Configfile search: /home/kjow/.fpc.cfg
Reading options from file /home/kjow/.fpc.cfg
Reading options from file /etc/fpc.cfg
Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Searching file /home/kjow/lazarus/fpc//lib/ld-linux.so.2... not found Searching file /home/kjow/lazarus/fpc//lib/ld-uClibc.so.0... not found Compiler: /usr/lib/fpc/2.5.1/ppcrossarm
Target OS: Linux for ARM
Using executable path: /usr/lib/fpc/2.5.1/
Using unit path: /home/kjow/lazarus/lcl/nonwin32/
Using unit path: /home/kjow/lazarus/lcl/
Using unit path: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/ Using unit path: /usr/lib/fpc/2.5.1/units/arm-linux/dbus/ Using unit path: /usr/lib/fpc/2.5.1/units/arm-linux/libcurl/ ...
Using unit path: /usr/lib/fpc/2.5.1/
Using include path: /home/kjow/lazarus/lcl/include/ Using library path: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/ Using library path: /home/kjow/lazarus/lcl/nonwin32/ Using library path: /home/kjow/lazarus/lcl/
Using library path: /usr/lib/fpc/2.5.1/units/arm-linux/dbus/ ...
Using library path: /usr/lib/fpc/2.5.1/
Using object path: /home/kjow/lazarus/lcl/nonwin32/ Using object path: /home/kjow/lazarus/lcl/
Using object path: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/ Using object path: /usr/lib/fpc/2.5.1/units/arm-linux/dbus/ ...
Using object path: /usr/lib/fpc/2.5.1/
Compiling LAzARM.lpr
Searching file LAzARM.lpr... found
(LAZARM) Registering new unit SYSTEM
(LAZARM) Load from LAZARM (implementation) unit SYSTEM (SYSTEM) Loading unit SYSTEM
Unitsearch: system.ppu
Searching file system.ppu... not found
Searching file SYSTEM.PPU... not found
Unitsearch: system.pp
Searching file system.pp... not found
Searching file SYSTEM.PP... not found
Unitsearch: system.pas
Searching file system.pas... not found
Searching file SYSTEM.PAS... not found
Unitsearch: /home/kjow/lazarus/lcl/nonwin32/system.ppu Searching file /home/kjow/lazarus/lcl/nonwin32/system.ppu... not found Searching file /home/kjow/lazarus/lcl/nonwin32/SYSTEM.PPU... not found Unitsearch: /home/kjow/lazarus/lcl/nonwin32/system.pp Searching file /home/kjow/lazarus/lcl/nonwin32/system.pp... not found Searching file /home/kjow/lazarus/lcl/nonwin32/SYSTEM.PP... not found Unitsearch: /home/kjow/lazarus/lcl/nonwin32/system.pas Searching file /home/kjow/lazarus/lcl/nonwin32/system.pas... not found Searching file /home/kjow/lazarus/lcl/nonwin32/SYSTEM.PAS... not found ...
PPU Loading /usr/lib/fpc/2.5.1/units/arm-linux/rtl/system.ppu (SYSTEM) PPU Name: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/system.ppu (SYSTEM) PPU Time: 2009/12/12 13:50:17
(SYSTEM) PPU Flags: 258177
(SYSTEM) PPU Crc: 1FF850C3
(SYSTEM) PPU Crc: 94512A7B (intfc)
(SYSTEM) Number of definitions: 3923
(SYSTEM) Number of symbols: 11410
(SYSTEM) Finished loading unit SYSTEM
Searching file LAzARM.lpr... found
Searching file LAzARM.lpr... found
(LAZARM) Registering new unit FPINTRES
(LAZARM) Load from LAZARM (implementation) unit FPINTRES (FPINTRES) Loading unit FPINTRES
Unitsearch: fpintres.ppu
Searching file fpintres.ppu... not found
Searching file FPINTRES.PPU... not found
Unitsearch: fpintres.pp
Searching file fpintres.pp... not found
Searching file FPINTRES.PP... not found
Unitsearch: fpintres.pas
Searching file fpintres.pas... not found
Searching file FPINTRES.PAS... not found
Unitsearch: /home/kjow/lazarus/lcl/nonwin32/fpintres.ppu Searching file /home/kjow/lazarus/lcl/nonwin32/fpintres.ppu... not found ...
(OBJPAS) Add dependency of OBJPAS to SYSTEM
(OBJPAS) Finished loading unit OBJPAS
Searching file LAzARM.lpr... found
(LAZARM) Registering new unit INTERFACES
(LAZARM) Registering new unit FORMS
(LAZARM) Registering new unit MAIN
(LAZARM) Registering new unit LRESOURCES
(LAZARM) Load from LAZARM (implementation) unit INTERFACES (INTERFACES) Loading unit INTERFACES
Unitsearch: Interfaces.ppu
Searching file Interfaces.ppu... not found
Searching file interfaces.ppu... not found
Searching file INTERFACES.PPU... not found
Unitsearch: Interfaces.pp
Searching file Interfaces.pp... not found
Searching file interfaces.pp... not found
Searching file INTERFACES.PP... not found
Unitsearch: Interfaces.pas
Searching file Interfaces.pas... not found
Searching file interfaces.pas... not found
Searching file INTERFACES.PAS... not found
Unitsearch: /home/kjow/lazarus/lcl/nonwin32/Interfaces.ppu Searching file /home/kjow/lazarus/lcl/nonwin32/Interfaces.ppu... not found Searching file /home/kjow/lazarus/lcl/nonwin32/interfaces.ppu... not found ...
...
...
...
...
...
Unitsearch: /home/kjow/lazarus/lcl/Interfac.pas
Searching file /home/kjow/lazarus/lcl/Interfac.pas... not found Searching file /home/kjow/lazarus/lcl/interfac.pas... not found Searching file /home/kjow/lazarus/lcl/INTERFAC.PAS... not found Unitsearch: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/Interfac.pp Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/Interfac.pp... not found Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/interfac.pp... not found Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/INTERFAC.PP... not found Unitsearch: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/Interfac.pas Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/Interfac.pas... not found Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/interfac.pas... not found Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/INTERFAC.PAS... not found ...
...
...
...
...
...
Searching file /usr/lib/fpc/2.5.1/interfac.pas... not found Searching file /usr/lib/fpc/2.5.1/INTERFAC.PAS... not found Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 34 lines
2009/12/12 Mattias Gaertner : > Probably you have somewhere an old ppu from your former experiments in > the search path. Add options -vu -vt to find out where it is. No, I don't have any old ppu. I restarted from a fresh ubuntu installation (it is a virtual machine, so I just overwrite the hard disk image). But I don't know where to put -vu -vt options in Lazarus IDE... I tried in Project->Compiler Options->Compilation->Show Options and added to the end. See below for: 1) Lazarus IDE compiling errors 2) command line compiling errors > Open the IDE compiler options. You can see that the IDE passes some -Fu > and other options. Simply copy those options if you want to compile > at the command line. Do you mean these Project->Compiler Options->Compilation->Show Options ? Thank You! Kjow 1) Lazarus IDE compiling errors Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg Hint: End of reading config file /etc/fpc.cfg Hint: End of reading config file /home/kjow/.fpc.cfg

You have a /home/kjow/.fpc.cfg ?

Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling LAzARM.lpr

I guess LAzARM.lpr is your project.

Compiling /home/kjow/lazarus/lcl/interfacebase.pp

Your project should not find this file.
You added the wrong unit paths (-Fu).
Adding the lcl source directories to your unit paths is not supported. Here should be your LCL ppus files:
/home/kjow/lazarus/lcl/units/arm-linux
/home/kjow/lazarus/lcl/units/gtk2/arm-linux

[...]

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/13 Mattias Gaertner :

You have a /home/kjow/.fpc.cfg ?

Yes, it is:

#INCLUDE /etc/fpc.cfg
#DEFINE DEMOTEST
#DEFINE DEMOTEST1
#DEFINE LAZARUS

-Fu/usr/lib/fpc/2.5.1/units/$fpctarget/*
-Fl/usr/lib/fpc/2.5.1/units/$fpctarget/rtl/
-Fu/home/kjow/lazarus/lcl/
-Fi/home/kjow/lazarus/lcl/include/
-Fu/home/kjow/lazarus/lcl/nonwin32/

-a
-Sd
-Xd
-Xs

-O-

#IFDEF CPUARM
;-XParm-linux-uclibc-
-XP/home/kjow/lazarus/fpc/binutils/
-Xr/usr/lib/fpc/2.5.1/units/arm-linux/rtl/
-XR/home/kjow/lazarus/fpc/
-darm
-CfSOFT
-CaEABI
-Tlinux
#ENDIF

I guess LAzARM.lpr is your project.

Yes, it is in ~/dev/TestARM/LazARM

Show quoted text 6 lines
Your project should not find this file. You added the wrong unit paths (-Fu). Adding the lcl source directories to your unit paths is not supported. Here should be your LCL ppus files: /home/kjow/lazarus/lcl/units/arm-linux /home/kjow/lazarus/lcl/units/gtk2/arm-linux

But I don't think I have added the lcl source directories to unit paths...

I'll check better tomorrow!

Thank you!

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 5 lines
2009/12/13 Mattias Gaertner : [...] -Fu/home/kjow/lazarus/lcl/ -Fi/home/kjow/lazarus/lcl/include/ -Fu/home/kjow/lazarus/lcl/nonwin32/

These are some of the lcl source paths.

Show quoted text 6 lines
> Adding the lcl source directories to your unit paths is not supported. > Here should be your LCL ppus files: > /home/kjow/lazarus/lcl/units/arm-linux > /home/kjow/lazarus/lcl/units/gtk2/arm-linux But I don't think I have added the lcl source directories to unit paths...

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/13 Mattias Gaertner :

Show quoted text 5 lines
> -Fu/home/kjow/lazarus/lcl/ > -Fi/home/kjow/lazarus/lcl/include/ > -Fu/home/kjow/lazarus/lcl/nonwin32/ These are some of the lcl source paths.

I removed these and, now themes.pas not found...

Lazarus IDE:

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
PPU Loading /home/kjow/lazarus/lcl/units/arm-linux/themes.ppu PPU Source: themes.pas not found
Recompiling Themes, checksum changed for LCLProc
themes.pas(11,35) Fatal: Can't find unit Themes used by InterfaceBase

Terminal:

~/dev/TestARM/LazARM$ fpc -Tlinux -Parm LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

Thanks again.

Kjow

Reply by email

Mattias Gaertner
to Kjow
Show quoted text 8 lines
2009/12/13 Mattias Gaertner : >> -Fu/home/kjow/lazarus/lcl/ >> -Fi/home/kjow/lazarus/lcl/include/ >> -Fu/home/kjow/lazarus/lcl/nonwin32/ > > These are some of the lcl source paths. I removed these and, now themes.pas not found...

Check with -vut. Probably you have still some wrongly created ppu from your former try in

~/dev/TestARM/LazARM

Mattias

Reply by email

Kjow
to Mattias Gaertner

2009/12/13 Mattias Gaertner :

Check with -vut. Probably you have still some wrongly created ppu from your former try in ~/dev/TestARM/LazARM

Perfect, there was this problem. A lot of trash in project dir. With a new project I have:

/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/kjow/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/kjow/lazarus/fpc/binutils/ld: cannot find -lX11 LAzARM.lpr(22) Error: Error while linking
LAzARM.lpr(22) Fatal: There were 1 errors compiling module, stopping

So I need to find arm-linux compiled libraries.

I grabbed someone like:

libX11.so.6
libX11.so.6.2.0

and I put these files here: /home/kjow/lazarus/fpc/libcross

Now, how can I tell to linker to search in this path?

An other question; compiling from terminal the same project above, I still have this problem:

~/dev/TestARM/LazARM$ fpc -Tlinux -Parm LAzARM.lpr Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Fatal: Can't find unit Interfaces used by LAzARM
Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

Thanks!

Reply by email