This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

Statically linking against libutil


Hi,

I have a program that makes openpty and login_tty calls (libutil), and I
need to link in all required libraries statically. For some reason gcc
fails to find the two symbols. Non-static linking works normally. I've
tried glibc 2.3.1/gcc 3.2.1 and glibc 2.2.4/gcc 2.95.4, for i386 and
arm. Any ideas?

Here's some code:

	#include <pty.h>
	#include <utmp.h>
	int main(void)
	{
		openpty(0,0,0,0,0);
		login_tty(0);
		return 0;
	}

And here's what it says:

	$ gcc -Wall -static -lutil -o test test.c
	/tmp/ccdcvE6F.o: In function `main':
	/tmp/ccdcvE6F.o(.text+0x14): undefined reference to `openpty'
	/tmp/ccdcvE6F.o(.text+0x21): undefined reference to `login_tty'
	collect2: ld returned 1 exit status

Timo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]