Sign in Join

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

Mailing lists / lazarus / 2010-06

Cross-compiling target libs

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Kjow

Hi!
I want to compile on Linux an SDL demo for arm by command line.

No problem for Windows and Linux targets, it compiles and the build runs well. But when I try to cross-compile for arm I can't find the right option to tell to fpc where are the target libs.

On Lazarus I use "Project/Compiler Options/Linking/Options (-k): -L/home/user/lazarus/fpc/libcross" and it is ok. But on terminal -L option won't work:

Error: Illegal parameter: -L/home/user/lazarus/fpc/libcross/

e.g.:

$ fpc -Tlinux -Parm SDLDemo.pas

Free Pascal Compiler version 2.4.0 [2010/06/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling SDLDemo.pas
SDLDemo.pas(31,3) Note: APPTYPE is not supported by the target OS Assembling sdlnewtonbasicdemo
Linking SDLDemo
/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 SDLDemo.pas(387) Error: Error while linking
SDLDemo.pas(387) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)

$ fpc -Tlinux -Parm -L/home/user/lazarus/fpc/libcross/ SDLDemo.pas Error: Illegal parameter: -L/home/user/lazarus/fpc/libcross/ 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

Mattias Gaertner
to Kjow
Show quoted text 7 lines
Hi! I want to compile on Linux an SDL demo for arm by command line. No problem for Windows and Linux targets, it compiles and the build runs well. But when I try to cross-compile for arm I can't find the right option to tell to fpc where are the target libs.

You wrote the solution yourself:

On Lazarus I use "Project/Compiler Options/Linking/Options (-k): -L/home/user/lazarus/fpc/libcross" and it is ok.

fpc -Tlinux -Parm -k-L/home/user/lazarus/fpc/libcross/ SDLDemo.pas

Mattias

Reply by email

Kjow
to Mattias Gaertner

2010/6/14 Mattias Gaertner :

Show quoted text 6 lines
You wrote the solution yourself: > On Lazarus I use "Project/Compiler Options/Linking/Options (-k): > -L/home/user/lazarus/fpc/libcross" and it is ok. fpc -Tlinux -Parm -k-L/home/user/lazarus/fpc/libcross/ SDLDemo.pas

Thank you!
I was in wrong, because I putted a space between -k and -L

Reply by email