This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dumb Question on GCC


On Tue, 1 Jul 2003, Martin Gainty wrote:

> GCC SlpReg.c
> /cygdrive/h/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccwParH7.o(.text+0x11d):SLPReg.c
> : un
> defined reference to `_SLPOpen'
>
> My header file refers to function SLPOpen not _SLPOpen
> The .c file calls SLPOpen not _SLPOpen

Meaning? You declare and define that function? Or you declare a library
function? If the latter, you need to link in the library e.g.

  $ gcc SlpReg.c -L/path/to/library/files -llib
  (where the path after `-L' is searched for a library named `lib')

> Where does the leading underscore come from ?
> How do I shut it off the compiler from introducing leading _?

That's how the linker referrs to the symbol name.

Elfyn
-- 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]