#5 Redhat 9.0 and "undefined reference to `errno'"

open
nobody
None
5
2003-12-12
2003-12-12
Anonymous
No

When running the installed rpm:
Incorrectly built binary which accesses errno or
h_errno directly. Needs to be fixed.
camserv v0.5.0 - by Jon Travis (jon@dsndata.com)

When attempting to install from source:
gcc -g -O2 -I/usr/X11R6/include -o camserv camconfig.o
camserv.o filter.o main_loop.o picture_loop.o shm.o
video.o -Wl,--export-dynamic
../libltdl/.libs/libltdlc.al -ldl ../common/libcommon.a
-lnsl /usr/lib/libjpeg.so -lm
camserv.o(.text+0x579): In function `main':
/root/packages/webcam/streaming/camserv-0.5.0/camserv/camserv.c:194:
undefined reference to `errno'
camserv.o(.text+0x682):/root/packages/webcam/streaming/camserv-0.5.0/camserv/camserv.c:182:
undefined reference to `errno'
main_loop.o(.text+0x181): In function `accept_client':
/root/packages/webcam/streaming/camserv-0.5.0/camserv/main_loop.c:144:
undefined reference to `errno'
main_loop.o(.text+0xe64): In function `main_loop':
/root/packages/webcam/streaming/camserv-0.5.0/camserv/main_loop.c:445:
undefined reference to `errno'
collect2: ld returned 1 exit status
make[1]: *** [camserv] Error 1
make[1]: Leaving directory
`/root/packages/webcam/streaming/camserv-0.5.0/camserv'
make: *** [all-recursive] Error 1

From hunting around Google It is a known problem with
many Redhat 9.0 installations/programs.

Discussion

  • Olivier Clavel

    Olivier Clavel - 2004-03-03

    Logged In: YES
    user_id=250681

    I am not a C guru.... but after looking into google for this
    apparently well known problem, it seems I got arround the
    thing by adding a line "#include <errno.ht>" to some files.
    Here are the diffs:

    *** /src/camserv/camserv-0.5.1/camserv/camserv.c
    2002-05-12 20:05:55.000000000 +0200
    --- camserv.c 2004-03-03 13:20:59.000000000 +0100
    ***************
    *** 25,30 ****
    --- 25,31 ----
    #include <stdarg.h>
    #include <signal.h>
    #include <sys/param.h>
    + #include <errno.h>

    #include "camconfig.h"
    #include "camshm.h"

    *** /src/camserv/camserv-0.5.1/camserv/main_loop.c
    2002-09-16 00:05:23.000000000 +0200
    --- main_loop.c 2004-03-03 13:21:44.000000000 +0100
    ***************
    *** 3,8 ****
    --- 3,9 ----
    #include <string.h>
    #include <stdarg.h>
    #include <signal.h>
    + #include <errno.h>

    #include "camserv.h"
    #include "camconfig.h"

    *** /src/camserv/camserv-0.5.1/camserv/picture_loop.c
    2002-03-11 01:51:44.000000000 +0100
    --- picture_loop.c 2004-03-03 13:22:00.000000000 +0100
    ***************
    *** 4,9 ****
    --- 4,10 ----
    #include <dlfcn.h>
    #include <sys/types.h>
    #include <signal.h>
    + #include <errno.h>

    #include "camserv.h"
    #include "camconfig.h"

    *** /src/camserv/camserv-0.5.1/relay/relay.c 2002-09-16
    00:13:16.000000000 +0200
    --- relay.c 2004-03-03 13:23:45.000000000 +0100
    ***************
    *** 22,27 ****
    --- 22,28 ----
    #include <stdlib.h>
    #include <string.h>
    #include <signal.h>
    + #include <errno.h>

    #include "databuf.h"
    #include "socket.h"

     

Log in to post a comment.