partial link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    #1

    partial link

    Hello all,

    This is a C++ linker question.

    I'm trying to build an obj file, say foo.obj so that it is pre-linked
    with its dependencies. However I do not want to generated an executable
    right away. Some people call this "partial linking". Note that
    packaging all dependent objs into a library is not an option. All I
    want is really one obj file whose dependencies have all been pre-linked
    with it, so when I link the final executable file I won't have to
    provide foo.obj's dependencies at that time.

    In linux I know this can be done using "ld -r -o", so I'm assuming
    there's got to be an equivalent way to do this with link.exe.

    Regards,

    Eric

  • David Lowndes

    #2
    Re: partial link

    >I'm trying to build an obj file, say foo.obj so that it is pre-linked
    >with its dependencies. However I do not want to generated an executable
    >right away. Some people call this "partial linking". Note that
    >packaging all dependent objs into a library is not an option. All I
    >want is really one obj file whose dependencies have all been pre-linked
    >with it, so when I link the final executable file I won't have to
    >provide foo.obj's dependencies at that time.
    Eric,

    I suspect that what you're looking for is #pragma comment (lib,..)

    Dave

    Comment

    • Ben Voigt

      #3
      Re: partial link


      "David Lowndes" <DavidL@example .invalidwrote in message
      news:kiq9m29lpi 48947139nqsmee7 8g9lefto1@4ax.c om...
      I'm trying to build an obj file, say foo.obj so that it is pre-linked
      >>with its dependencies. However I do not want to generated an executable
      >>right away. Some people call this "partial linking". Note that
      >>packaging all dependent objs into a library is not an option. All I
      >>want is really one obj file whose dependencies have all been pre-linked
      >>with it, so when I link the final executable file I won't have to
      >>provide foo.obj's dependencies at that time.
      >
      Eric,
      >
      I suspect that what you're looking for is #pragma comment (lib,..)
      The final project would still need the dependent libraries available.

      However, making a DLL would act in the fashion desired, unless you are
      trying to avoid that when you say "I do not want to generate an executable
      right away".
      >
      Dave

      Comment

      • David Lowndes

        #4
        Re: partial link

        >I'm trying to build an obj file, say foo.obj so that it is pre-linked
        >>>with its dependencies. However I do not want to generated an executable
        >>>right away. Some people call this "partial linking". Note that
        >>>packaging all dependent objs into a library is not an option. All I
        >>>want is really one obj file whose dependencies have all been pre-linked
        >>>with it, so when I link the final executable file I won't have to
        >>>provide foo.obj's dependencies at that time.
        >>
        >Eric,
        >>
        >I suspect that what you're looking for is #pragma comment (lib,..)
        >
        >The final project would still need the dependent libraries available.
        That's true. I'd read the question more as "I wouldn't have to specify
        foo.obj's dependencies at that time"

        Dave

        Comment

        Working...