Вопрос

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.

Это было полезно?

Решение

The function is forkpty, not ptyfork. See the documentation.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top