partial link

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

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
 
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
 
David Lowndes said:
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".
 
I'm trying to build an obj file, say foo.obj so that it is pre-linked
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
 
Back
Top