### Author Topic: compiling fpc under windows 7  (Read 2259 times)

#### sergioafern

• Newbie
• Posts: 4
##### compiling fpc under windows 7
« on: March 13, 2018, 03:44:55 pm »
ok, this is the first time I  try to co0mpile the FPC from source code.
is open a file called pp.lpi with lazarus, and an run -> compile.

however I get an error at line 286:
{\$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }

so, here is my question... where can I find instructions on how to compile the FPC compiler from the source code.

#### Bart

• Hero Member
• Posts: 3167
##### Re: compiling fpc under windows 7
« Reply #1 on: March 13, 2018, 03:51:11 pm »
Fastest way:

Code: [Select]
cd path/to/fpcmake allmake install
This requires that you have 32-bit fpc 3.0.4 in your path.
It will build fpc and install it to the default path: c:\pp
It'll take a while, because it will cycle building the compiler.

Bart

#### sergioafern

• Newbie
• Posts: 4
##### Re: compiling fpc under windows 7
« Reply #2 on: March 13, 2018, 04:21:55 pm »
OK, thanks.. I did that. it created a file called ppc1.exe

I created a simple hello world program.
when I try to compile it (using ppc1 hello.pas) I get this error:
fatal: can't find unit system used by hello.
fatal: compilation aborted.

• Hero Member
• Posts: 7195
##### Re: compiling fpc under windows 7
« Reply #3 on: March 13, 2018, 04:59:33 pm »
If you stopped the compilation at ppc1 then you made a mistake. It needs to become ppc2, ppc3, until it subsequently becomes named ppc386 or ppcx86 or ppcarm etc depending on platform.
After that, the make rtl and packages will be automatically compiled with that last compiler. On a slow intel system that will take about 20 minutes. On the Raspberry Pi 3 the same.
You should not interrupt the make but let it run until everything is finished.
« Last Edit: March 13, 2018, 05:14:03 pm by Thaddy »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

#### sergioafern

• Newbie
• Posts: 4
##### Re: compiling fpc under windows 7
« Reply #4 on: March 13, 2018, 06:15:23 pm »
I did not interrupt it.. but I did see  many error 2 message.

#### sergioafern

• Newbie
• Posts: 4
##### Re: compiling fpc under windows 7
« Reply #5 on: March 13, 2018, 06:21:22 pm »
ok, I got it to compile an executable called ppcx64.exe

however, trying to compile a simple hello world program still give me the error:

fatal: can't find unit system used by hello

#### marcov

• Global Moderator
• Hero Member
• Posts: 6627
##### Re: compiling fpc under windows 7
« Reply #6 on: March 13, 2018, 06:51:32 pm »
Search for "freepascal buildfaq". Get the pdf.

#### Bart

• Hero Member
• Posts: 3167
##### Re: compiling fpc under windows 7
« Reply #7 on: March 14, 2018, 12:07:03 am »
ok, I got it to compile an executable called ppcx64.exe

however, trying to compile a simple hello world program still give me the error:

fatal: can't find unit system used by hello

You should not try to compile calling ppcx64.exe that resides in the path\to\fpcsource\compiler directory.
Instead, if "make install" worked as expected (no errors), then fpc.exe will be in c:\pp\bin\x86_64 (?) (mine is in i386-win32 subdir, not sure how the 64-bit one is called). Also inside that folder there should be a fpc.cfg file, which a plain "make install" does not create.
Without the fpc.cfg file the compiler will not find any unit at all, not even the system unit.

There is a utility to create a .cfg file, I can't remember exactly what it's called (fpcmkcfg.exe looks like a good candidate, it'll reside in the same folder as fpc.exe), not how to use it.
Or you can just copy the fpc.cfg from your starting compiler (3.0.4) than use search and replace to adjust the paths.

Bart

#### Pascal

• Hero Member
• Posts: 783
##### Re: compiling fpc under windows 7
« Reply #8 on: March 14, 2018, 06:10:45 am »
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)