Xref: utzoo comp.databases:8255 comp.lang.c:34890 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!catfood From: catfood@NCoast.ORG (Mark W. Schumann) Newsgroups: comp.databases,comp.lang.c Subject: Re: Clipper/C Problem Summary: Use of library cos() function in Extend Keywords: Clipper Message-ID: <1990Dec23.221139.12962@NCoast.ORG> Date: 23 Dec 90 22:11:39 GMT References: <1654@ciss.Dayton.NCR.COM> Sender: catfood@ncoast.org (Mark W. Schumann, Cleveland, Ohio (Go Browns?)) Organization: North Coast Computer Resources (ncoast) Lines: 47 dgrimmer@ciss.Dayton.NCR.COM (Dave.Grimmer@Dayton.NCR.COM) writes: >I am using Clipper 87 and MS C 5.10 to try to do some trig functions. >The programs and command lines used to link them are shown below. >Basically, the problem is that I get an unresolved external refference >to "_cos" in a program that try to do a cosine function. I probably >have missed something simple. If you have any experience interfacing >Clipper and MS C, please look at this simple problem and let me know >what I have missed. Any help would be appreciated... >CLIPPER djgcos() >{ > double i; > i=_parnd(1); > _retnd(cos(i / 57.29578)); >} >LINK WITH MS LINK 3.65 >---------------------- >link /NOE test.obj djgcos.obj ,,, \clipper\clipper >RESULTS: >------- >LINK : error L2029: Unresolved externals: >_cos in file(s): > DJGCOS.OBJ(djgcos.c) Your C function simply does some setup and calls the function named cos() that should be in one of the Microsoft C libraries. But you're only linking in CLIPPER.LIB. (By the way, most C compilers stick a leading underscore in front of function names; this doesn't have a whole lot to do with your problem.) Try linking in whatever MSC library contains cos(). That might give you a different linker error because cos() itself may call functions that are assumed to be in the MSC startup code. In that case you might want to go really crazy and tinker with the startup code or write your own cos(). In general, it is not as easy as it looks to interface C and Clipper when your C requires the use of library functions. I hope this helps a little. -- ============================================================ Mark W. Schumann 3111 Mapledale Avenue, Cleveland 44109 USA Domain: catfood@ncoast.org UUCP: ...!mailrus!usenet.ins.cwru.edu!ncoast!catfood