Re: trouble compiling sane-1.0.2 on linux

From: Bernhard Mogens Ege (bme@vision.auc.dk)
Date: Thu Jul 20 2000 - 06:44:33 PDT

  • Next message: abel deuring: "Re: trouble compiling sane-1.0.2 on linux"

    >>>>> "abel" == abel deuring <a.deuring@satzbau-gmbh.de> writes:

    > Bernhard Mogens Ege wrote:
    >>
    >> I have just downloaded the 1.0.2 source and was compiling it when this
    >> error popped up:
    >>
    >> gcc -c -DHAVE_CONFIG_H -I. -I. -I../include -I../include -D_GNU_SOURCE -DPATH_SANE_CONFIG_DIR=/pack-linux86/sane-1.0.2/etc/sane.d -DPATH_SANE_DATA_DIR=/pack-linux86/sane-1.0.2/share -DV_MAJOR=1 -DV_MINOR=0 -g -O2 -W -Wall -DSCSIBUFFERSIZE=131072 sanei_scsi.c -fPIC -DPIC -o .libs/sanei_scsi.lo
    >> In file included from linux_sg3_err.h:4,
    >> from sanei_scsi.c:230:
    >> /usr/include/linux/../scsi/sg.h:100: redefinition of `struct sg_header'
    >> /usr/include/linux/../scsi/sg.h:118: redefinition of `struct sg_scsi_id'
    >> /usr/include/linux/../scsi/sg.h:128: warning: redefinition of `Sg_scsi_id'
    >> /usr/include/scsi/sg.h:211: warning: `Sg_scsi_id' previously declared here
    >> make[1]: *** [sanei_scsi.o] Error 1
    >> make[1]: Leaving directory `/pack-linux86/sane-1.0.2/src/sane-1.0.2/sanei'
    >> make: *** [all-recursive] Error 1
    >>
    >> I have run "./configure --prefix=/pack-linux86/sane-1.0.2" followed by
    >> make. I am using the 2.2.16 kernel and have enabled SCSI support.

    > Bernhard,

    > you have probably more than one version of sg.h installed on your
    > machine; the "Suse default" for example is to put a really old version
    > of sg.h in /usr/include/scsi, and a recent version in
    > /usr/linux/include/scsi.

    > Run "find /usr . -name sg.h -print" to get a list of all files named
    > sg.h, 

    [snip]

    My list:

    /usr/include/scsi/sg.h
    /usr/src/linux-2.2.16/include/scsi/sg.h
    /usr/src/linux-2.2.16/include/config/chr/dev/sg.h
    /usr/src/linux-2.2.14/include/scsi/sg.h
    /usr/src/linux-2.2.14/include/config/chr/dev/sg.h
    /usr/i386-glibc20-linux/include/scsi/sg.h

    This is the order of some of the included files for compiling
    sane_scsi.c:

    /usr/include/scsi/sg.h
    ../include/sane/sanei_scsi.h
    linux_sg3_err.h
     /usr/include/linux/../scsi/scsi.h
     /usr/include/linux/../scsi/sg.h

    On my machine, /usr/include/scsi/sg.h and
    /usr/include/linux/../scsi/sg.h do NOT resolve to the same
    file. /usr/include/linux/../scsi/sg.h resolves to
    /usr/src/redhat/include/scsi/sg.h as /usr/include/linux is a symbolic
    link to /usr/src/linux/include/linux

    This problem seems to occur because of that link. This is however that
    usual redhat way (in my experience).

    I have created a c program, which includes <scsi/sg.h> twice which
    causes no trouble.

    It seems to me that sane should use either /usr/include/scsi/sg.h OR
    /usr/src/redhat/include/scsi/sg.h, but not both.

    Is my system messed up or should sane be modified to use only one sg.h?

    regards,

    Bernhard Ege

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Thu Jul 20 2000 - 06:42:39 PDT