
Learning how to use cl.exe
Quote:
> Hi.
> I'm pretty new to C, and very new to building things on Win32. Can
> anybody point me at some resources that will get me up to speed on
> what different file types are and the basics of linking various object
> files together into libraries, etc? I'm using the compiler that comes
> with Visual Studio 6 from the command line (cl.exe).
Very briefly (because this is off-topic):
.c ---- C file
.obj ---- object file
.lib ---- library file
.exe ---- executable file
To link various object files together into a library, use the LIB
command (unless MS have changed this recently, which they may have done,
which is one reason why it's a better idea to ask this question in a
Windows programming newsgroup).
To link an existing library into your code (let's say it's called
mylib.lib), the following should be sufficient:
cl -Za -W4 myprog.c mylib.lib
In future, please try to ask platform-specific questions like this in
platform-specific newsgroups (e.g. comp.os.ms-windows.programmer.win32)
- comp.lang.c is for questions about the C language itself, not
Microsoft tools.
Thanks.
<snip>
--
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton