Tagging 1.99.1
[linux_from_scratch.git] / FAQ-OBSOLETE / sh-utils-getloadavg.xml
blobdb4a6e43411e66bef6a797fa629ff41269af9ee7
1 <qandaentry id="sh-utils-getloadavg">
2 <question><para>My static sh-utils build is failing
3 with "undefined reference to `getloadavg'".</para></question>
4 <answer><para>If you're trying to build static sh-utils
5 and you're getting an error like this:
6 <screen>gcc  -g -O2  -static -o uptime  uptime.o ../lib/libsu.a -lutil
7 uptime.o: In function `print_uptime':
8 /lfs/tmp/sh-utils-2.0/src/uptime.c:125: undefined reference to `getloadavg'
9 collect2: ld returned 1 exit status
10 make[2]: *** [uptime] Error 1
11 make[2]: Leaving directory `/lfs/tmp/sh-utils-2.0/src'
12 make[1]: *** [all-recursive] Error 1
13 make[1]: Leaving directory `/lfs/tmp/sh-utils-2.0'
14 make: *** [all-recursive-am] Error 2
15 </screen>
16 I am unable to reproduce this error and so cannot present a tested solution,
17 but two solutions have been posted by others.
18 I suggest trying them in the following order:
19 <itemizedlist>
21 <listitem><para><ulink url="http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0507.html"/>:
22 This attempts to correct the incorrectly generated config.h
23 and should be the correct solution if you can get it to work
24 by following the description given in the post.
25 </para></listitem>
27 <listitem><para>If that doesn't work, delete the sources,
28 re-extract, and try this:
29 <ulink url="http://archive.linuxfromscratch.org/mail-archives/blfs-support/2001/06/0495.html"/>.
30 This attempts to avoid compiling uptime at all
31 since it won't be needed in chroot
32 and compiling uptime dynamically in chroot
33 doesn't have this problem.
34 </para></listitem>
36 </itemizedlist>
37 </para></answer>
38 </qandaentry>