From: alainm AT news DOT RISQ DOT QC DOT CA (Alain Magloire) Subject: Re: inline functions -- unknown references Newsgroups: comp.os.msdos.djgpp References: X-Newsreader: TIN [version 1.2 PL2] Lines: 29 Message-ID: <6P5b4.6783$36.56920@carnaval.risq.qc.ca> Date: Fri, 31 Dec 1999 17:34:58 GMT NNTP-Posting-Host: 132.206.63.174 X-Complaints-To: abuse AT mcgill DOT ca X-Trace: carnaval.risq.qc.ca 946661698 132.206.63.174 (Fri, 31 Dec 1999 12:34:58 EST) NNTP-Posting-Date: Fri, 31 Dec 1999 12:34:58 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com sl (junk AT bbs DOT darktech DOT org) wrote: : Hi, : I'd like to make some of my functions 'inline'.. As far as I know, : placing the word 'inline' right before the function implementation should be : enough.. Unfortunately when I do this and I call these functions from other : source-files, I get "unknown reference" errors.. I was told this had to do : with the fact that I am calling inline functions in one source-file from : ANOTHER source-file.. Supposidly that's illegal.. : Could someone please explain this to me? I would like to inline my : GFX library functions (such as plot()ing a pixel) but be able to use them : from other files.. This seems reasonable enough no? :) I'm assuming this is C, albeit, GNU C, gcc. Did you have a header file containing the prototype : extern __inline__ function (); and that header is included when needed. BTW, inline functions really work in gcc, when optimization is turn on. In C++, IIRC, any methods define in the class are inline by default. -- au revoir, alain ---- Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!