• LINK386 Help

    From Don Guy@1:249/176 to All on Sun Dec 2 07:04:48 2001
    Greetings All!

    I'm still picking away at producing an OS/2 text-mode application which uses a DOS executable as the stub.

    I ran into problems using the linker which accompanies Borland C++, and after some helpful input from others decided to have a go at using LINK386. It does not appear to like me however.

    Using the object files produced by Borland's compiler, it returns the following
    error:
    main.obj(main.cpp) : fatal error L1101: invalid object module
    Object file offset: 22d Record type: b0

    It appears as though LINK386 does not come with any documentation, and when it comes to compiling and/or linking outside of an IDE, I'm a virgin. Anyone mind
    deflowering me? ;-)

    -Don



    ... Hex Dump: Where Witches put used Curses.
    ---
    * Origin: EI/2 [Carleton Place, Ontario, Canada] (1:249/176)
  • From Fred Kantor@2:252/171 to Don Guy on Sun Dec 2 15:23:00 2001
    In a message dated 12-02-01, Don Guy said to All:
    I'm still picking away at producing an OS/2 text-mode
    application which uses a DOS executable as the stub.

    I ran into problems using the linker which accompanies Borland C++,
    and after some helpful input from others decided to have a go at
    using LINK386. It does not appear to like me however.

    Using the object files produced by Borland's compiler, it returns
    the following error:
    main.obj(main.cpp) : fatal error L1101: invalid object module
    Object file offset: 22d Record type: b0

    If I may ask... did you make a program .DEF file?

    Here is a .DEF example, from FWKFF.COM, which I wrote in 1999 as
    two assembly-language programs, one for DOS 16-bit, the other for
    OS/2 protected mode 32-bit:

    ----------------------------cut here, start FWKFF.DEF
    NAME FWKFF WINDOWCOMPAT ; stays in window when called there ;DESCRIPTION "@#Frederick W Kantor:2.04a#@ FWKFF Fast Find." ; for
    BLDLEVEL.EXE STUB 'stub_ff.exe' ; DOS version of program PROTMODE
    EXETYPE OS2
    STACKSIZE 0x2000
    ----------------------------cut here

    ---
    ■ testing... ■
    * Origin: FONiX Info Systems * Berkshire UK * www.fonix.org (2:252/171)
  • From Fred Kantor@2:252/171 to Don Guy on Sun Dec 2 16:03:00 2001
    In a message dated 12-02-01, Don Guy said to All:
    I'm still picking away at producing an OS/2 text-mode
    application which uses a DOS executable as the stub.

    I ran into problems using the linker which accompanies Borland C++,
    and after some helpful input from others decided to have a go at
    using LINK386. It does not appear to like me however.

    Using the object files produced by Borland's compiler, it returns
    the following error:
    main.obj(main.cpp) : fatal error L1101: invalid object module
    Object file offset: 22d Record type: b0

    (My apologies: this message is to correct for misleading line
    wrap.)

    If I may ask... did you make a program .DEF file?

    Here is a .DEF example, from FWKFF.COM, which I wrote in 1999 as
    two assembly-language programs, one for DOS 16-bit, the other for
    OS/2 protected mode 32-bit:

    ----------------------------cut here, start FWKFF.DEF
    NAME FWKFF WINDOWCOMPAT ; stays in window when called
    ;DESCRIPTION "@#Frederick W Kantor:2.04a#@ FWKFF Fast Find."
    STUB 'stub_ff.exe' ; DOS version
    PROTMODE
    EXETYPE OS2
    STACKSIZE 0x2000
    ----------------------------cut here

    ---
    ■ testing... ■
    * Origin: FONiX Info Systems * Berkshire UK * www.fonix.org (2:252/171)
  • From Don Guy@1:249/176 to Fred Kantor on Wed Dec 5 00:40:16 2001
    Greetings Fred!

    A long time ago, in a galaxy far, far away, a coded message from Fred Kantor
    to Don Guy was intercepted...

    If I may ask... did you make a program .DEF file?

    I did, however it has nowhere near the content of yours. NAME, DESCRIPTION, and STUB directives only.

    What puzzles me is LINK386's complaint about an invalid object file, where Borland's linker has none.

    -Don



    ... Hard Drive Backed Up? Try Hex-Lax!
    ---
    * Origin: EI/2 [Carleton Place, Ontario, Canada] (1:249/176)
  • From Fred Kantor@2:252/171 to Don Guy on Wed Dec 5 12:24:00 2001
    In a message dated 12-05-01, Don Guy said to Fred Kantor:
    If I may ask... did you make a program .DEF file?
    I did, however it has nowhere near the content of yours. NAME, DESCRIPTION, and STUB directives only.
    What puzzles me is LINK386's complaint about an invalid object
    file, where Borland's linker has none.

    Just a thought, but... for two different assemblers -- ALP (IBM)
    and A386 (Eric Isaacson) -- I found that different starting
    material was needed to produce usable object code; at that time,
    A386 needed to have a particular setup "front-end" to set the order
    of components in the output object.

    I wrote that program a while ago:
    FWKFF.ASM 17134 01/18/1996 01:40
    Things may have changed since then.

    Have you looked to see if some front-end material like that might
    be needed to produce acceptable .obj code?

    Here is what I used to set the .obj order for A386 (I've moved the
    ";<--<< ALP A386 different" to fit the message width):

    -----------------------------------------cut here
    TITLE FWKFF Fast Find
    NAME FWKFF

    .386

    ; in A386, put FLAT in every SEGMENT definition

    ; the order of these empty segments sets order in .OBJ

    ;<--<< ALP A386 different

    CODE32 SEGMENT DWORD FLAT PUBLIC 'CODE' ;
    CODE32 ENDS ;
    ;
    DATA32 SEGMENT DWORD FLAT PUBLIC 'DATA' ;
    DATA32 ENDS ;
    ;
    CONST32 SEGMENT DWORD FLAT PUBLIC 'CONST' ;
    CONST32 ENDS ;
    ;
    BSS32 SEGMENT DWORD FLAT PUBLIC 'BSS' ;
    BSS32 ENDS ;
    ;
    DGROUP GROUP CONST32, BSS32, DATA32 ;
    ASSUME CS:FLAT, DS:FLAT, SS:FLAT, ES:FLAT ; ----------------------------------------------------cut here

    ---
    ■ testing... ■
    * Origin: FONiX Info Systems * Berkshire UK * www.fonix.org (2:252/171)
  • From Don Guy@1:249/176 to Fred Kantor on Thu Dec 6 00:39:59 2001
    Greetings Fred!

    A long time ago, in a galaxy far, far away, a coded message from Fred Kantor
    to Don Guy was intercepted...

    Just a thought, but... for two different assemblers -- ALP (IBM) and
    A386 (Eric Isaacson) -- I found that different starting material was needed to produce usable object code;
    <snip>
    Have you looked to see if some front-end material like that might be needed to produce acceptable .obj code?

    I honestly wouldn't know where to start--the program in question was written in
    C++, and my assembly is about as rusty as the undercarriage of my 15 year-old-car. :-)

    In a discussion I was having with David Noon, he mentioned that he had experienced problems getting LINK386 to handle Borland-produced objects. He successfully compiled & linked my code using Watcom tools however. I may not spend too much time on this, and have a go at downloading Open Watcom.


    -Don



    ... Set Crash=C:\Windows\
    ---
    * Origin: EI/2 [Carleton Place, Ontario, Canada] (1:249/176)
  • From David Noon@2:257/609.5 to Don Guy on Mon Dec 10 10:30:10 2001
    Hi Don,

    Replying to a message of Don Guy to Ian Moote:

    Here she be:

    === Start pwd2.def ===
    NAME pwd WINDOWCOMPAT
    DESCRIPTION 'Password Generator v1.1, by Don Guy'
    STUB 'pwd2-d.exe'
    EXETYPE OS2
    === End pwd2.def ===

    The EXETYPE statement is redundant, as the TLINK you are using only supports OS/2; likewise with LINK386.

    You would do well to replace it with a STACKSIZE statement, unless you are defining the stack size in your project file. When you are linking stand-alone then STACKSIZE is pretty much mandatory, or else you get the linker default.

    Regards

    Dave
    <Team PL/I>

    --- FleetStreet 1.25.1
    * Origin: My other computer is an IBM S/390 (2:257/609.5)