Subject: FreeBSD 5.0 (again), undefined reference to mkstemps()
To: None <current-users@netbsd.org>
From: Aron Stansvik <elvstone@home.se>
List: current-users
Date: 10/29/2003 00:47:57
Hey, me again. Thanks for the quick fix last time. Now I have another
problem.

My build fails at when linking the "cpp" target, saying:

/usr/home/elvis/misc/netbsd/src/gnu/usr.bin/gcc3/libiberty/obj/libiberty.a(make-temp-file.o):
In function `make_temp_file':
make-temp-file.o(.text+0x246): undefined reference to `mkstemps'
collect2: ld returned 1 exit status

The failed command is:

/usr/home/elvis/misc/netbsd/src/obj/tooldir.FreeBSD-5.0-RELEASE-i386/bin/i386--netbsdelf-gcc
-o cpp -nostdlib
-Wl,-rpath-link,/usr/home/elvis/misc/netbsd/dest/lib:/usr/home/elvis/misc/netbsd/dest/usr/lib
-L/usr/home/elvis/misc/netbsd/dest/lib
/usr/home/elvis/misc/netbsd/dest/usr/lib/crt0.o
/usr/home/elvis/misc/netbsd/dest/usr/lib/crti.o
/usr/home/elvis/misc/netbsd/dest/usr/lib/crtbegin.o cppspec.o
-L/usr/home/elvis/misc/netbsd/src/gnu/usr.bin/gcc3/frontend/obj
-lfrontend
-L/usr/home/elvis/misc/netbsd/src/gnu/usr.bin/gcc3/libiberty/obj
-liberty -L/usr/home/elvis/misc/netbsd/dest/usr/lib
-L/usr/home/elvis/misc/netbsd/dest/usr/lib -lgcc -lc -lgcc
/usr/home/elvis/misc/netbsd/dest/usr/lib/crtend.o
/usr/home/elvis/misc/netbsd/dest/usr/lib/crtn.o

which surprises me, since mkstemps() is a standard C library function,
and the above command includes the -lc flag. I'm not a good programmer
myself, but maybe there's someone out there with FreeBSD 5.x who knows
better than me what the problem is.

Thanks in advance.

Sincerely,
Aron Stansvik

--
unemployed