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 libc.
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':
: undefined
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 standard C
?
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 getline
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':
: undefined
to grab lines? My gut tells me to copy the getline()
function from the KR 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 fine solution to your
situation. Otherwise, getch(stdin) with a bit
() is not safe to use what
should I use to grab lines? My gut tells me to copy the getline()
function from the KR 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 fine solution to your
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
___
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 program to recreate the following error:
##Error##
/var/tmp
On Sat, 2006-02-18 at 15:33 -0500, Tom Grove wrote:
#include stdio.h
#include readline/readline.h
#include readline/history.h
int main() {
char *line;
line = readline(Test: );
return 0;
}
It compiles and works with gcc -o readline readline.c -l readline. You
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 KR 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
tells me to
copy the getline() function from the KR book but I'm not
totally sure that's a great idea either. Stupid strings always
causing problems!
This is a frequently recurring question in comp.lang.c. There
are perfectly portable ways to use only ANSI C functions to read
a full line of text
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 stdio.h
int main
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':
: undefined reference to `getline
14 matches
Mail list logo