[comp.sys.ibm.pc] MSC 4.0 Lib usage?

murphy@pur-phy (William J. Murphy) (02/19/88)

HELP !!
I have been trying to learn the appropriate usage of the Lib 
utility in microsoft c 4.0.  I have created a set of subroutines
which manipulate complex numbers using the structure defined in 
math.h (structure { double x,y; };).  I have used the subroutines
as source code in an include file named cmath.h and stuck the file
in directory \include.  Now, I wish to combine the cmath.h object
code with the library(ies) in \Lib.  

So far, I have separated each subroutine (e.g. cadd.c, csub.c, ...)
and compiled them separately with the command msc /AL.

I have used Lib to create a library called cmath.lib which contains
(I think) all of my object code.  I looked at cmath.lib with pctools 
saw each subroutine name in the library.

I also took math.h, removed all of MSC function names, and edited
in all of the function names I have created
into math.h and removed two of the structure declarations that will
be redundant when including math.h. (I assume that the user will also
include math.h) I renamed my edited math.h to cmath.h.

I put cmath.h in \include, cmath.lib in \lib and local directory.
When I cl /AL prog.c cmath.lib  I get
invalid object module
cmath.lib pos:1 Record type : F0

What do I need to do to make the cmath.lib file and include file?
I am not a hacker, so be gentle and explicit.

I prefer e-mail, but this may be of general interest.

Thanks,
William J. Murphy			| Does Ralph Nader know anything |
Physics Dept.				| about noise pollution and the  |
Purdue University			| problem of cochlear emissions? |
murphy@newton.physics.purdue.edu

creps@silver.bacs.indiana.edu (Steve Creps) (02/20/88)

   Mail failed, so I'm posting this here.

In article <998@pur-phy> you write:
>
>HELP !!

>I put cmath.h in \include, cmath.lib in \lib and local directory.
>When I cl /AL prog.c cmath.lib  I get
>invalid object module
>cmath.lib pos:1 Record type : F0

   Sounds like it's trying to take your cmath.lib as an .obj file instead
of a .lib file. Try the -l option, which tells it what arguments to send to
link. Probably something like cl -AL prog.c -lprog,,,cmath.lib   would work.
Hope this helps.
--Steve

-      -       -       -       -       -       -       -       -	-
Steve Creps on the VAX 8650 running Ultrix 2.0-1 at Indiana University.
creps@silver.bacs.indiana.edu (192.12.206.2), ...iuvax!silver!creps,
creps@iubacs.bitnet "Hey fellas, it's a four-legged V-8!"

jennings@boulder.Colorado.EDU (Jeff Jennings) (02/20/88)

my mailer chokes on the reply-to address, so i'm posting.

try this:
	cl /AL prog.c /link cmath.lib

this is the equivalent to the unix command
	cc prog.c -lcmath
good luck!!

- jeff

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Jeff Jennings
University of Colorado, Boulder