Forum > FPC development

Make system unit

(1/6) > >>

Okoba:
Hi,

I wanted to try making a new system unit for a test, as explained here:
https://wiki.freepascal.org/System_unit
I made a system.pas unit into a blank project without any package and added the code explained in the wiki page, but In the last stable Lazarus and also Trunk, it gives an error on the "interface" line and says:

--- Quote ---system.pas(3,1) Error: Internal error 2016060303
--- End quote ---

Am I missing something?

marcov:
Yes, look at the parameters:

e:\archive>fpc -h |grep -i system
     -T<x>  Target operating system:
      -Us        Compile a system unit
      -Xn        Use target system native linker instead of GNU ld (Solaris, AIX)

A system unit must be compiled with -Us, since it must not implicitely  import the system unit obviously.

Okoba:
If you mean adding -Us to project custom options I did it already.
To be more precise I did these:

* Make a new black project in FPC and Lazarus Trunk
* Add a new unit called system.pas
* Add the code from the wiki page
* Add -Usto custom options in project options
* Compile and get the error at the interface with this number 2016060303

PascalDragon:

--- Quote from: OkobaPatino on April 20, 2020, 07:41:09 am ---I wanted to try making a new system unit for a test, as explained here:
https://wiki.freepascal.org/System_unit
I made a system.pas unit into a blank project without any package and added the code explained in the wiki page, but In the last stable Lazarus and also Trunk, it gives an error on the "interface" line and says:

--- Quote ---system.pas(3,1) Error: Internal error 2016060303
--- End quote ---

--- End quote ---

I wouldn't advice to use that article as a base. There is quite some functionality required inside the System unit that the compiler expects to be there.

What exactly are you trying to achieve in the end?

Okoba:
Learning.
As I read the Docs I found out the System unit is the only unit added if we use FPC mode, and we can make our own if we have the requirements, so I like to do that.

Navigation

[0] Message Index

[#] Next page

Go to full version