The function is forkpty
, not ptyfork
. See the documentation.
Error compiling with GCC using pty
Вопрос
I'm messing with the pty with C, but for some reason the code doesnt compiles
#include <pty.h>
#include <stdlib.h>
#include <stdio.h>
void main(){
int fd;
ptyfork(&fd,NULL,NULL,NULL);
}
I compiled with -lutil, and outputs the next error:
gcc -lutil test3.c -o test3
/tmp/ccgTfZvt.o: In function 'main':
test3.c:(.text+0x24): undefined reference to `ptyfork'
collect2: ld returned 1 exit status
What am I missing?
Note: im compiling in ubuntu 12.04 LTS 64-bit
Edit: Tried gcc test3.c -o test3 -lutil
without success.
Решение
Не связан с StackOverflow