2

I know that a OBJ file produced after compilation of C/C++ source code in any standard compiler generates OBJ file, which later LINKed with the rest of the required libraries to form the EXEcutable file. I want to know the format/structure of the OBJ file. Please go ahead.

Prasoon Saurav
  • 91,295
  • 49
  • 239
  • 345
getsuha
  • 711
  • 6
  • 16

3 Answers3

6

C++ Builder (and Delphi) use OMF format obj files. See this wikipedia link for details.

Additional information: Microsoft Visual C++ use an incompatible COFF, that's why C++ Builder have a utility to convert them.

See also: What's the difference between the OMF and COFF format?

Community
  • 1
  • 1
J-16 SDiZ
  • 26,473
  • 4
  • 65
  • 84
1

the .obj file is a format used by Microsoft Compilers and is described in the (Common Object File Format) COFF spec

other compilers use different formats to store object code, e.g. ELF on Linux

pmeerw
  • 425
  • 3
  • 8
-1

Under windows, it'd be a COFF object. Google this file format for a spec. They are linked to produce a PE.

Alex Budovski
  • 17,947
  • 6
  • 53
  • 58