Recent

Author Topic: COFF Magic Error  (Read 521 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: 8880
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!
Most people that want to use threading should learn to patch their jeans first: use a needle.

engkin

  • Hero Member
  • *****
  • Posts: 2513
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7432
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: 1123
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. 
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.