For example, there is three object files a.obj b.obj c.obj
just compiled out with cl
, and it is desired to combine them into one combined.obj
.
A comment of an SO question points out that on *nix it's possible to do this kind of thing with ld
. However, cl
and link
all seems only support .exe
, .dll
and .lib
as output.
The whole procedure of what I want to do with the combined object file as follows:
a.obj b.obj c.obj
->
combined.obj
combined.obj d.obj e.obj
->
executable.exe
My problem is solved. a.obj b.obj c.obj
use some variables and functions yet to be linked, and I thought that .lib
can't tolerant missing functions since it is a library, but in fact it is OK. I can just merge them into an .lib
file:
lib *.obj /OUT:combined.lib