linking libraries - OS2

This is a discussion on linking libraries - OS2 ; I have a compiler that produces executable files that won't run unless you also have a couple of DLL files in your LIBPATH. Interestingly, the compiler came with not only those DLL files, but a couple of LIB files with ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: linking libraries

  1. linking libraries

    I have a compiler that produces executable files that won't run unless
    you also have a couple of DLL files in your LIBPATH. Interestingly,
    the compiler came with not only those DLL files, but a couple of LIB
    files with identical root filenames to the two DLL files. I've looked
    through the documentation to see if there might be some way to link
    those LIB files to the executable, thus eliminating the need to have
    the DLL files in the LIBPATH, but I haven't found anything. Might
    thre be a way to do it using the OS/2 system linker? I can imagine
    that it might require using a command line option on the compiler to
    produce only an object file and not an executable, and then letting
    the linker link that object file to the two libraries.


  2. Re: linking libraries

    tholen@antispam.ham wrote:

    > I have a compiler that produces executable files that won't run unless
    > you also have a couple of DLL files in your LIBPATH. Interestingly,
    > the compiler came with not only those DLL files, but a couple of LIB
    > files with identical root filenames to the two DLL files.


    Is this a static library or an import library? The latter only
    identifies entry points in the DLL.

    I've looked
    > through the documentation to see if there might be some way to link
    > those LIB files to the executable, thus eliminating the need to have
    > the DLL files in the LIBPATH, but I haven't found anything. Might
    > thre be a way to do it using the OS/2 system linker? I can imagine
    > that it might require using a command line option on the compiler to
    > produce only an object file and not an executable, and then letting
    > the linker link that object file to the two libraries.
    >


    That sounds about right to me. Just include the libraries on the
    command line when you link.


  3. Re: linking libraries


    > I've looked through the documentation to see if there might be some
    > way to link those LIB files to the executable


    With LINK386: "LINK386 DUMMY.OBJ" (and press a few times)
    With ILINK: "ILINK /? | MORE" (look for lib, page 1)

    IIRC both should show how to somehow specify *.LIB files. If you have
    the OS/2 toolkit, I guess REXXUTIL.MAK contains an example w.r.t. the
    file REXX.LIB (and using an *.OBJ file).



    ---

  4. Re: linking libraries

    Peter Flass writes:

    >> I have a compiler that produces executable files that won't run unless
    >> you also have a couple of DLL files in your LIBPATH. Interestingly,
    >> the compiler came with not only those DLL files, but a couple of LIB
    >> files with identical root filenames to the two DLL files.


    > Is this a static library or an import library? The latter only
    > identifies entry points in the DLL.


    After taking a quick look at the contents of the libraries using a
    hex file viewer, I don't see much of what I would expect code to look
    like, but there are lots of redundant occurrences of a string like
    "basemodel", which leads me to believe that it might just be an import
    library, in which case the compiler probably already linked those
    two libraries when it built the application.

    >> I've looked
    >> through the documentation to see if there might be some way to link
    >> those LIB files to the executable, thus eliminating the need to have
    >> the DLL files in the LIBPATH, but I haven't found anything. Might
    >> thre be a way to do it using the OS/2 system linker? I can imagine
    >> that it might require using a command line option on the compiler to
    >> produce only an object file and not an executable, and then letting
    >> the linker link that object file to the two libraries.


    > That sounds about right to me. Just include the libraries on the
    > command line when you link.


    I suppose it wouldn't hurt to try, but if they are import libraries,
    then it won't accomplish what I was hoping to do.


+ Reply to Thread