Recent

Author Topic: Compiling applications!  (Read 8865 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Compiling applications!
« on: June 10, 2010, 01:49:15 am »
Question! If I made a program on my Ubuntu 64bit with Lazarus and always wanted to compile 32bit on my machine as I do!?


Same thing if I had the same program on a Windows PC to 32bit and want to compile 64-bit, as I do?

Thanks for any answers!
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiling applications!
« Reply #1 on: June 10, 2010, 05:01:24 am »
You need a cross-compiler. Please build one yourself from the source since AFAIK no prebuilt binaries exist. How? First, make sure you have the source. Then, type: make all install INSTALL_PREFIX=<your fpc installation dir> CPU_TARGET=i386 (for 32-bit intel). If successful, you'll have ppccross386 in <lib your fpc installation dir>/fpc/<fpc version> folder.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #2 on: June 15, 2010, 12:34:59 am »
Despite many attempts I could not! Could you give me more precise information please?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Compiling applications!
« Reply #3 on: June 15, 2010, 01:51:17 am »
I think Leledumbo was very precise. What didn't you understand?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #4 on: June 15, 2010, 02:03:39 am »
First, by what route I run the command:

make all install INSTALL_PREFIX=<your fpc installation dir> CPU_TARGET=i386

Second thing is: ppccross386 in <lib your fpc installation dir>/fpc/<fpc version> folder
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Compiling applications!
« Reply #5 on: June 15, 2010, 04:53:16 am »
By "<your fpc installation dir>" he means you must write your fpc installation directory path here, and by "<fpc version>" he means the full version number of your compiler.

For example, on my system (GNU/Linux) I should write;
Code: [Select]
make all install INSTALL_PREFIX=/usr/lib CPU_TARGET=i386
And the directory where I'll find the "ppccross386" executable would be /usr/lib/fpc/2.4.0.

If you're using another operating system and/or fpc version you must use different values.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #6 on: June 15, 2010, 05:44:28 am »
I have not explained properly, by which path should I run the command?

/usr/lib/lazarus ?
/usr/lib/fpc ?

From where?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiling applications!
« Reply #7 on: June 16, 2010, 12:05:39 am »
The source path. If you extract it in /usr/share/fpcsrc, then you should run it from there

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #8 on: June 16, 2010, 05:18:51 am »
 :o
Then do so, I installed lazarus on ubuntu 10.04 and is located in /usr/lib/ lazaru the folder where I have 0.9.28.2 and link lazarus-ide (a 0.9.28.2/lazarus). In /usr/share/fpcsrc I have the following folder 2.4.0.

Where do I go to run the command? How parameterize?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiling applications!
« Reply #9 on: June 16, 2010, 05:51:10 am »
open a terminal, cd to that folder, then type the command I gave above.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #10 on: June 16, 2010, 05:56:52 am »
open a terminal, cd to that folder, then type the command I gave above.
Sorry what folder?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Compiling applications!
« Reply #11 on: June 18, 2010, 03:14:53 am »
francesco@francesco-laptop:~$ cd /usr/share/fpcsrc/
francesco@francesco-laptop:/usr/share/fpcsrc$ make all install INSTALL_PREFIX=/usr/lib CPU_TARGET=i386
make: *** Nessuna regola per creare l'obiettivo «all».  Arresto.
francesco@francesco-laptop:/usr/share/fpcsrc$


Why?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiling applications!
« Reply #12 on: June 18, 2010, 05:00:35 am »
Do you really extract the fpc source into that folder? write here what `ls` (type in terminal, without the backquote) say in that folder. And the INSTALL_PREFIX should be /usr instead of /usr/lib. /usr will install binaries in /usr/bin and support files in /usr/lib/fpc/<fpc version>. You can imagine if you give /usr/lib instead.

 

TinyPortal © 2005-2018