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: undefined reference to `_getline'


> >   In porting soem code to run under Cygwin, I ran
> > into a problem finding getline().  The following
> > code snippet demonstrates the problem:
> 
> getline() is a glibc-ism, a nonstandard GNU extension.  It's 
> not listed anywhere that I can see at
> <http://cygwin.com/cygwin-api/cygwin-api.html> so I'd say it's safe to
> assume that it's not supported by Cygwin.

It's declared in /usr/include/stdio.h, and it doesn't
look like it's guarded by any relevant #define:

	$ gcc -E /usr/include/stdio.h  | grep getline
	ssize_t __attribute__((__cdecl__)) __getline (char **, size_t *, FILE *);

Grumble.  Looking through the archives shows that
getline() isn't exported:

http://www.cygwin.com/ml/cygwin/2003-06/msg01328.html

Can't understand how I missed this on my first search.

cgf, et al - is there a reason why getline and getdelim
aren't exported, or is this just another example of good
ol' fashion Cygwin meanness?

> I'm pretty sure you could
> work around this by rolling your own.  In fact, a little googling
> returned the following:
> <http://www.klid.dk/pub/gnu/gnu-utils/gnu/txtutil1.22/lib/getline.c>

Yes - I found this almost immediately.  My concern is
that it *looks* like getline() is available, but it
isn't.

-Samrobb

--
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]