TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jeffrey White
from: Jonathan de Boyne Pollard
date: 1996-01-27 11:17:36
subject: PM programs with WatW

JW>
  >  In other words [with Watcom C++ 10.5] should I always write a .def
  >  file (all book examples have a .def file) so that when I compile
  >  under another compiler .........
JW>

  Watcom C++ is idiosyncratic when it comes to linking programs. IBM's
  LINK386 (also used by MetaWare), Borland's TLINK, and even EMX's
  EMXOMFLD all use the concepts of a module definition file to control
  module names, module exports, and segmentation, and everything else
  that controls which (object, map, def, exe) files the linker reads and
  writes being on the command line (or in a linker response file) in a
  specific order.

  Watcom's WLINK is different, and is in many ways a cleaner design. The
  entire process of linking from specifying what files to link to which
  functions to export is controlled by linker directives, which may be
  either on the command line or in a linker directive (.LNK) file.

  IBM's ILINK is approaching the Watcom design, since the command line
  is now not in a fixed format, but still requires a module definition
  file for controlling imports, exports and suchlike.

  In answer to your question, I'd say that if portability was a concern,
  it's not that hard to take a Watcom linker directive file and split it
  into a module definition file and a linker response file for other
  linkers.  However, I'd only do this when it becomes necessary.
  Maintaining those extra files is just so much extra work.

  Book examples, incidentally, rarely acknowledge that there are any
  other compilers than those written by IBM.  This is exceedingly
  annoying, not only because it is narrowminded, but also because it
  generates the impression that there is One True Way for programming
  tools to work.  This is simply not the case.

  Since I posess quite a few C++ compilers (-: , I tend to mix and match
  my tools.  For example, I prefer Borland's TDUMP over MetaWare's BD
  and IBM's EXEHDR for dumping OBJ, LIB, DLL, and EXE files, but prefer
  MetaWare's LIB utility to Borland's TLIB, and IBM's LIB.

    > JdeBP  Keeper of the <
   > Highly Unofficial FIDONET OS2PROG C++ Compiler Pros and Cons List <
       > Available via File Request as PROSCONS.ZIP from 2:440/4.0 <
___
 X MegaMail 2.10 #0:
--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.