Re: getline function

2006-02-20 Thread Michael P. Soulier
On 18/02/06 Tom Grove said: > That works and I had looked into that earlier...it seems like it does a > lot more than just one function from the man page. I guess I can use > that for now but I wonder why getline() is broken in gcc on FreeBSD? getline() is from glibc. FreeBSD uses it's own lib

Re: getline function

2006-02-18 Thread Giorgos Keramidas
question is being that it's not standard and gets() is not safe > to use what should I use to grab lines? My gut tells me to > copy the getline() function from the K&R book but I'm not > totally sure that's a great idea either. Stupid strings always > causing pr

Re: getline function

2006-02-18 Thread Giorgos Keramidas
gt;>> Yeah...I see that after some more research. So, now I guess my question >>> is being that it's not standard and gets() is not safe to use what >>> should I use to grab lines? My gut tells me to copy the getline() >>> function from the K

Re: getline function

2006-02-18 Thread Mike Jeays
On Sat, 2006-02-18 at 15:33 -0500, Tom Grove wrote: > #include > #include > #include > > int main() { > char *line; > > line = readline("Test: "); > > return 0; > } It compiles and works with "gcc -o readline readline.c -l readline". You need to tell the loader about

Re: getline function

2006-02-18 Thread Mike Jeays
On Sat, 2006-02-18 at 13:00 -0500, Tom Grove wrote: > Mike Jeays wrote: > > On Fri, 2006-02-17 at 21:54 -0500, Tom Grove wrote: > > > >> Is there anyone who can compile a program using the getline() function? > >> Here is a really simple progra

Re: getline function

2006-02-18 Thread James Bailie
Tom Grove wrote: > ##Error## > /var/tmp//ccqxIZxQ.o(.text+0x25): In function `main': > : undefined reference to `readline' > ##Error## You forgot to pass -lreadline to the compiler. -- James Bailie <[EMAIL PROTECTED]> http://www.jamesbailie.com ___ fr

Re: getline function

2006-02-18 Thread Tom Grove
() is not safe to use what should I use to grab lines? My gut tells me to copy the getline() function from the K&R book but I'm not totally sure that's a great idea either. Stupid strings always causing problems! Depending on what you'd like to do, GNU readline may be

Re: getline function

2006-02-18 Thread Chuck Swiger
t safe to use what > should I use to grab lines? My gut tells me to copy the getline() > function from the K&R book but I'm not totally sure that's a great idea > either. Stupid strings always causing problems! Depending on what you'd like to do, GNU readline may be a

Re: getline function

2006-02-18 Thread Tom Grove
Mike Jeays wrote: On Fri, 2006-02-17 at 21:54 -0500, Tom Grove wrote: Is there anyone who can compile a program using the getline() function? Here is a really simple program to recreate the following error: ##Error## /var/tmp//ccvYIi4C.o(.text+0x26): In function `main': : unde

Re: getline function

2006-02-18 Thread Tom Grove
? getline() is not part of the standard C library. What makes you think gcc is broken...? Yeah...I see that after some more research. So, now I guess my question is being that it's not standard and gets() is not safe to use what should I use to grab lines? My gut tells me to copy the ge

Re: getline function

2006-02-18 Thread Chuck Swiger
Tom Grove wrote: > Mike Jeays wrote: [ ... ] > That works and I had looked into that earlier...it seems like it does a > lot more than just one function from the man page. I guess I can use > that for now but I wonder why getline() is broken in gcc on FreeBSD? getline() is not part of the standar

Re: getline function

2006-02-18 Thread Tom Grove
Mike Jeays wrote: On Fri, 2006-02-17 at 21:54 -0500, Tom Grove wrote: Is there anyone who can compile a program using the getline() function? Here is a really simple program to recreate the following error: ##Error## /var/tmp//ccvYIi4C.o(.text+0x26): In function `main': : unde

Re: getline function

2006-02-17 Thread Mike Jeays
On Fri, 2006-02-17 at 21:54 -0500, Tom Grove wrote: > Is there anyone who can compile a program using the getline() function? > Here is a really simple program to recreate the following error: > > ##Error## > /var/tmp//ccvYIi4C.o(.text+0x26): In function `main': > :

getline function

2006-02-17 Thread Tom Grove
Is there anyone who can compile a program using the getline() function? Here is a really simple program to recreate the following error: ##Error## /var/tmp//ccvYIi4C.o(.text+0x26): In function `main': : undefined reference to `getline' ##Error## ##Source File## #include