Recent

Author Topic: COFF Magic Error  (Read 2797 times)

kiko_of_davao

  • Newbie
  • Posts: 1
COFF Magic Error
« on: April 27, 2019, 11:51:51 am »
I am new to Lazarus. I wish to use it to enable existing Turbo Pascal (Ver 7.0) .EXE files to run under Windows 10.  My .PAS source file contains  the link directive {$L  VGADRV.OBJ}.   This .OBJ file is in the same directory as the .PAS file.  When I attempt to compile this in Lazarus IDE v2.02 I get the Error message:

          "Error: Illegal COFF Magic while reading C:\Lazarus\Play_Pen\VGADRV.OBJ

What work-around can I use to enable compilation?  Thank you for your insights

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: COFF Magic Error
« Reply #1 on: April 27, 2019, 12:20:13 pm »
COFF is not OMF. TP mode doesn't understand that binary format. And that is correct!
Specialize a type, not a var.

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: COFF Magic Error
« Reply #2 on: April 27, 2019, 12:32:03 pm »
What work-around can I use to enable compilation?  Thank you for your insights

Try objconv.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: COFF Magic Error
« Reply #3 on: April 27, 2019, 12:51:26 pm »
Where does the obj come from? If it is from TP, it won't work as TP is 16-bit and FPC (generally) 32 or 64-bit.

440bx

  • Hero Member
  • *****
  • Posts: 3946
Re: COFF Magic Error
« Reply #4 on: April 27, 2019, 01:49:54 pm »
Try objconv.
Very nice stuff there.  Thank you for mentioning it.

Now, I'm really wondering how I never "bumped" into that site before. 
(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