generating static library

  • Thread starter Thread starter Bonj
  • Start date Start date
B

Bonj

(using 2005 beta 1 SDK)
what tool is used to link static libraries?
I am trying to create a static library, but when I run
link /out:"project1.lib" project1.obj
it gives me 'could not open file 'project1.lib'' - as if it's thinking that
is an input file?
I can't use the /DLL option as then it will create a .dll, when I want to be
able to link all the functions into the app with all the code in the .lib
file, not the DLL.
I noticed there is also a tool called lib.exe - is this what I should be
using? However it is only in the Win64 folder of the SDK, so do I need to
download the VC2003 toolkit in order to get it?
 
Bonj said:
(using 2005 beta 1 SDK)
what tool is used to link static libraries?
I am trying to create a static library, but when I run
link /out:"project1.lib" project1.obj
it gives me 'could not open file 'project1.lib'' - as if it's thinking that
is an input file?
I can't use the /DLL option as then it will create a .dll, when I want to be
able to link all the functions into the app with all the code in the .lib
file, not the DLL.
I noticed there is also a tool called lib.exe - is this what I should be
using? However it is only in the Win64 folder of the SDK, so do I need to
download the VC2003 toolkit in order to get it?

Use lib.exe. The versions of link.exe that I have support an undocumented
/LIB switch that appears to just launch lib.exe by proxy.
 
That's great Jeff and good to know knowledge... I have tested it here on my
work computer and it works. But I have got Visual Studio at work...
 
Is it an undocumented feature that lib.exe is part of the standard Visual
Studio, but not part of the free SDK other than for 64 bit programs?

I think I'm going to have about 9 DLLs for this program, so I'm happy to go
with DLLs. But if I'm ever building a program that doesn't need many "generic
components" and/or if most of the "generic components" are build specially
for that program, then I'll want to link it all in. And that's no matter
whether I'm building a C# or C++ program, or both (obviously if I want to
combine them I have to have a DLL...) but as a rule of thumb I say if there's
going to be more than 3 separate projects then I have them all as DLLs, if
not, then link in.
 
Back
Top