Recent

Author Topic: .ppu and .o files  (Read 680 times)

440bx

  • Hero Member
  • *****
  • Posts: 4070
.ppu and .o files
« on: May 15, 2022, 06:48:18 am »
Hello,

I was under the, probably mistaken, impression that as long as the compiler could find the .ppu files it could compile and link a program.

I setup a directory with all my .ppu files and no .o files.  When I tried to compile my programs, I got a warning that there was no .o file and linking might fail and indeed it failed.  When I put a set of .o files for each .ppu file in the directory then everything worked normally.

My question is: are the .o files always required ? I was under the impression that the ppu files were all that is needed to compile and link a program (IOW, the .o files would be created as needed from the .ppu files, isn't that the case ?)

Thank you for your help.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: .ppu and .o files
« Reply #1 on: May 15, 2022, 08:10:37 am »
.ppu files only contain all information the compiler needs. .o files only contain all information the linker needs.

440bx

  • Hero Member
  • *****
  • Posts: 4070
Re: .ppu and .o files
« Reply #2 on: May 15, 2022, 08:20:25 am »
.ppu files only contain all information the compiler needs. .o files only contain all information the linker needs.
If I understand you correctly, the .o files are always required to make the linker happy because the linker cannot use the .ppu files.  Correct ?
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: .ppu and .o files
« Reply #3 on: May 15, 2022, 09:02:31 am »
The .o files contain the program's machine code. The .ppu files don't. The linker needs the program's machine code to be able to create the program, hence it needs the .o files.

440bx

  • Hero Member
  • *****
  • Posts: 4070
Re: .ppu and .o files
« Reply #4 on: May 15, 2022, 09:24:45 am »
The .o files contain the program's machine code. The .ppu files don't. The linker needs the program's machine code to be able to create the program, hence it needs the .o files.
Great, thank you Jonas.  Now, I understand.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018