Re: trouble compiling sane-1.0.2 on linux

From: abel deuring (a.deuring@satzbau-gmbh.de)
Date: Thu Jul 20 2000 - 05:54:02 PDT

  • Next message: Bernhard Mogens Ege: "Re: trouble compiling sane-1.0.2 on linux"

    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, 

    (Output for the Linux box I'm using to write this mail:

    /usr/include/scsi/sg.h
    /usr/src/linux-2.2.13.SuSE/include/config/chr/dev/sg.h
    /usr/src/linux-2.2.13.SuSE/include/scsi/sg.h
    /usr/i486-glibc20-linux/include/scsi/sg.h )

    Rename all of them except one, and create symlinks pointing to the one
    file you keep. referably, you should keep sg.h from the kernel 2.2.16
    source:

            cd /usr/include/scsi
            mv sg.h sg-old.h

    then, for the example output shown above:

            ln -s /usr/src/linux-2.2.13.SuSE/include/scsi/sg.h sg.h

    or, for your machine:

            ln -s /usr/src/include/scsi/sg.h sg.h

    Abel

    --
    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 - 05:50:50 PDT