uClinux 内核编译常见错误及解决方法(zt)

uClinux 内核编译常见错误及解决方法(uClinux kernel compile Troubleshooting)


    uClinux kernel compile Troubleshooting V 0.1
    chinajz
    c_xvidtune@hotmail.com
    http://spaces.msn.com/chinajz/

    ===============================================
    Q
    arm-elf-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing  -mlittle-endian -mtune=arm710 -march=armv3 -msoft-float  -fno-builtin -nostdinc -D_LIBC -I../../../../include -I.  -fstrict-aliasing -Os   -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -c syscall.c -o syscall.o
    cc1: warning: -g with -fomit-frame-pointer may not give sensible debugging
    syscall.c: In function `syscall':
    syscall.c:40: `__NR_syscall' undeclared (first use in this function)
    syscall.c:40: (Each undeclared identifier is reported only once
    syscall.c:40: for each function it appears in.)
    make[6]: *** [syscall.o] Error 1
    make[6]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps/linux/arm'
    make[5]: *** [arm] Error 2
    make[5]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps/linux'
    make[4]: *** [_dir_linux] Error 2
    make[4]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps'
    make[3]: *** [_dir_sysdeps] Error 2
    make[3]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    A
    /opt/uClinux-dist/uClibc/libc/sysdeps/linux/arm/syscal.c
    add include file:
    ln -s /opt/uClinux-dist/linux-2.6.x/include/asm-arm ./uClibc/include/

    #include <asm-arm/unistd.h>
    ===========================================================
    In file included from /opt/uClinux-dist/lib/libgmp/mpn/generic/dump.c:26:
    /opt/uClinux-dist/uClibc/include/stdio.h:693: parse error before `fpos_t'
    /opt/uClinux-dist/uClibc/include/stdio.h:698: parse error before `*'
    make[3]: *** [dump.o] Error 1
    make[3]: Leaving directory `/opt/uClinux-dist/lib/libgmp/mpn'
    make[2]: *** [mpn/libmpn.a] Error 2
    make[2]: Leaving directory `/opt/uClinux-dist/lib/libgmp'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2


    vi /opt/uClinux-dist/uClibc/include/stdio.h
    ......
    /* This define avoids name pollution if we're using GNU stdarg.h */
    # define __need___va_list
    #include <stdarg.h>

    /* The type of the second argument to `fgetpos' and `fsetpos'.  */
    /*__BEGIN_NAMESPACE_STD
    #ifndef __USE_FILE_OFFSET64
    typedef __STDIO_fpos_t fpos_t;
    #else
    typedef __STDIO_fpos64_t fpos_t;
    #endif
    __END_NAMESPACE_STD
    #ifdef __USE_LARGEFILE64
    typedef __STDIO_fpos64_t fpos64_t;
    #endif*/
    #ifndef __USE_FILE_OFFSET64
    typedef _UC_fpos_t fpos_t;
    #else
    typedef _UC_fpos64_t fpos_t;
    #endif
    #ifdef __USE_LARGEFILE64
    typedef _UC_fpos64_t fpos64_t;
    #endif
    ....

    Q
    arm-elf-strip -x -R .note -R .comment __syscall_setgroups.o
    arm-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -mlittle-endian -mtune=arm710 -march=armv3 -msoft-float -fno-builtin -nostdinc -D_LIBC -I../../../../include -I. -fstrict-aliasing -Os -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -DL__reboot syscalls.c -c -o _reboot.o
    syscalls.c:1007: config/autoconf.h: No such file or directory
    make[6]: *** [_reboot.o] Error 1
    make[6]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps/linux/common'
    make[5]: *** [common] Error 2
    make[5]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps/linux'
    make[4]: *** [_dir_linux] Error 2
    make[4]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps'
    make[3]: *** [_dir_sysdeps] Error 2
    make[3]: Leaving directory `/opt/uClinux-dist/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/opt/uClinux-dist/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    A
    syscalls.c:1007===> #include <linux/autoconf.h>
    -------------------------------------------------
    Q
    arch=armv3 -msoft-float -fno-builtin -nostdinc -D_LIBC -I../../include -I. -fstrict-aliasing -Os -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -DL___glibc_strerror_r wstring.c -c -o __glibc_strerror_r.o
    cc1: warning: -g with -fomit-frame-pointer may not give sensible debugging
    wstring.c:1574: `__glibc_strerror_r' undeclared here (not in a function)
    wstring.c:1574: warning: type defaults to `int' in declaration of `__strerror_r'
    wstring.c:1575: `__glibc_strerror_r' undeclared here (not in a function)
    wstring.c:1575: warning: type defaults to `int' in declaration of `_glibc_strerror_r'
    wstring.c:1575: `_glibc_strerror_r' redeclared as different kind of symbol
    ../../include/string.h:260: previous declaration of `_glibc_strerror_r'
    wstring.c: In function `__glibc_strerror_r':
    wstring.c:1579: warning: implicit declaration of function `__xpg_strerror_r'
    make[4]: *** [__glibc_strerror_r.o] Error 1
    make[4]: Leaving directory `/opt/uClinux-dist/uClibc/libc/string'
    make[3]: *** [_dir_string] Error 2
    make[3]: Leaving directory `/opt/uClinux-dist/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/opt/uClinux-dist/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    A
    /* Copyright (C) 2002 Manuel Novoa III
    *
    * This library is free software; you can redistribute it and/or
    * modify it under the terms of the GNU Library General Public
    * License as published by the Free Software Foundation; either
    * version 2 of the License, or (at your option) any later version.
    *
    * This library is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    * Library General Public License for more details.
    *
    * You should have received a copy of the GNU Library General Public
    * License along with this library; if not, write to the Free
    * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    */

    /* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
    *
    * Besides uClibc, I'm using this code in my libc for elks, which is
    * a 16-bit environment with a fairly limited compiler. It would make
    * things much easier for me if this file isn't modified unnecessarily.
    * In particular, please put any new or replacement functions somewhere
    * else, and modify the makefile to use your version instead.
    * Thanks. Manuel
    *
    * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */

    /* Dec 20, 2002
    * Initial test implementation of strcoll, strxfrm, wcscoll, and wcsxfrm.
    * The code needs to be cleaned up a good bit, but I'd like to see people
    * test it out.
    *
    * Sep 11, 2003
    * Patch by Atsushi Nemoto <anemo@mba.ocn.ne.jp> to do arch-required
    * mapping of signal strings (alpha, mips, hppa, sparc).
    */

    #define _STDIO_UTILITY
    #define _GNU_SOURCE
    #include <string.h>
    #include <strings.h>
    #include <stdio.h>
    #include <limits.h>
    #include <ctype.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <signal.h>
    #include <assert.h>
    #include <locale.h>

    #ifdef WANT_WIDE
    #include <wchar.h>
    #include <wctype.h>
    #include <bits/uClibc_uwchar.h>

    #define Wvoid wchar_t
    #define Wchar wchar_t
    #define Wuchar __uwchar_t
    #define Wint wchar_t

    #else

    #define Wvoid void
    #define Wchar char
    typedef unsigned char __string_uchar_t;
    #define Wuchar __string_uchar_t
    #define Wint int

    #endif

    /**********************************************************************/
    /* NOTE: If we ever do internationalized syserr messages, this will
    * have to be changed! */

    #define _SYS_NERR 125
    #if defined(__mips__) || defined(__sparc__)
    /* sparce and mips have an extra error entry, as EDEADLK and EDEADLOCK have
    * different meanings on those platforms. */
    #undef _SYS_NERR
    #define _SYS_NERR 126
    #endif

    #ifdef __UCLIBC_HAS_ERRNO_MESSAGES__
    #define _SYS_ERRMSG_MAXLEN 50
    #else /* __UCLIBC_HAS_ERRNO_MESSAGES__ */
    #define _SYS_ERRMSG_MAXLEN 0
    #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */


    extern const char _string_syserrmsgs[];

    #define _SYS_NSIG 32

    #ifdef __UCLIBC_HAS_SIGNUM_MESSAGES__
    #define _SYS_SIGMSG_MAXLEN 25
    #else /* __UCLIBC_HAS_SIGNUM_MESSAGES__ */
    #define _SYS_SIGMSG_MAXLEN 0
    #endif /* __UCLIBC_HAS_SIGNUM_MESSAGES__ */

    extern const char _string_syssigmsgs[];


    #if _SYS_ERRMSG_MAXLEN < __UIM_BUFLEN_INT + 14
    #define _STRERROR_BUFSIZE (__UIM_BUFLEN_INT + 14)
    #else
    #define _STRERROR_BUFSIZE _SYS_ERRMSG_MAXLEN
    #endif

    #if _SYS_SIGMSG_MAXLEN < __UIM_BUFLEN_INT + 15
    #define _STRSIGNAL_BUFSIZE (__UIM_BUFLEN_INT + 15)
    #else
    #define _STRSIGNAL_BUFSIZE _SYS_SIGMSG_MAXLEN
    #endif

    /**********************************************************************/
    -------------------------------------

    .PHONY: dummy subdirs release distclean clean config oldconfig menuconfig

    1) You should use the current CVS, or daily snapshot version of
    uClibc, which addresses this problem.

    2) You should NOT be directly using linux 2.6.x kernel header
    files. You should instead using the sanitized:
    http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
    from:http://www.uclibc.org/lists/uclibc/2004-October/010202.html
    --------------------------------------------------------
    cc1: warning: -g with -fomit-frame-pointer may not give sensible debugging
    In file included from gmon.c:38:
    ../../../../include/stdio.h:75: parse error before `fpos_t'
    ../../../../include/stdio.h:75: warning: type defaults to `int' in declaration of `fpos_t'
    ../../../../include/stdio.h:75: warning: data definition has no type or storage class
    ../../../../include/stdio.h:80: parse error before `fpos64_t'
    ../../../../include/stdio.h:80: warning: type defaults to `int' in declaration of `fpos64_t'
    ../../../../include/stdio.h:80: warning: data definition has no type or storage class
    In file included from gmon.c:38:
    ../../../../include/stdio.h:508: parse error before `fpos_t'
    ../../../../include/stdio.h:509: warning: function declaration isn't a prototype
    ../../../../include/stdio.h:511: warning: type defaults to `int' in declaration of `fpos_t'
    ../../../../include/stdio.h:511: parse error before `*'
    ../../../../include/stdio.h:511: warning: function declaration isn't a prototype
    ../../../../include/stdio.h:538: parse error before `fpos64_t'
    ../../../../include/stdio.h:539: warning: function declaration isn't a prototype
    ../../../../include/stdio.h:540: warning: type defaults to `int' in declaration of `fpos64_t'
    ../../../../include/stdio.h:540: parse error before `*'
    ../../../../include/stdio.h:540: warning: function declaration isn't a prototype
    make[6]: *** [gmon.o] Error 1
    make[6]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps/linux/common'
    make[5]: *** [common] Error 2
    make[5]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps/linux'
    make[4]: *** [_dir_linux] Error 2
    make[4]: Leaving directory `/opt/uClinux-dist/uClibc/libc/sysdeps'
    make[3]: *** [_dir_sysdeps] Error 2
    make[3]: Leaving directory `/opt/uClinux-dist/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/opt/uClinux-dist/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    A
    vi uClinux-dist/uClibc/libc/sysdeps/linux/common/Makefile
    TOPDIR=../../../../
    include $(TOPDIR)Rules.mak

    CSRC= waitpid.c getdnnm.c gethstnm.c getcwd.c ptrace.c /
    mkfifo.c setegid.c wait.c getpagesize.c seteuid.c /
    wait3.c setpgrp.c getdtablesize.c create_module.c /
    cmsg_nxthdr.c longjmp.c open64.c ftruncate64.c mmap64.c /
    truncate64.c getrlimit64.c setrlimit64.c creat64.c /
    llseek.c pread_write.c _exit.c sync.c getdirname.c /
    sendfile64.c xstatconv.c getdents.c getdents64.c vfork.c /
    ulimit.c ntp_gettime.c
    ifneq ($(strip $(EXCLUDE_BRK)),y)
    CSRC+=sbrk.c
    endif
    ifeq ($(strip $(UCLIBC_PROFILING)),y)
    CSRC+=gmon.c
    endif
    ifeq ($(strip $(UCLIBC_PROPOLICE)),y)
    CSRC+=ssp.c
    endif
    COBJS=$(patsubst %.c,%.o, $(CSRC))

    MSRC=syscalls.c
    MOBJ=$(shell ./list_syscalls.sh)

    OBJ=$(COBJS) $(MOBJ)

    all: $(STR_SYSCALLS) $(OBJ) $(LIBC)

    $(LIBC): ar-target

    ar-target: $(OBJ)
    $(AR) $(ARFLAGS) $(LIBC) $(OBJ)

    $(MOBJ): $(MSRC)
    $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
    $(STRIPTOOL) -x -R .note -R .comment $*.o

    $(COBJS): %.o : %.c
    $(CC) $(CFLAGS) -c $< -o $@
    $(STRIPTOOL) -x -R .note -R .comment $*.o

    headers:
    $(LN) -fs ../libc/sysdeps/linux/common/fpu_control.h $(TOPDIR)/include/

    clean:
    $(RM) *.[oa] *~ core crt[in].* *.S
    ---------------------------------------------
    Q
    make[5]: Entering directory `/root/uClinux-dist/uClibc/libc/misc/mntent'
    arm-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fstrict-aliasing -Os -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -mlittle-endian -msoft-float -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -I/usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -c mntent.c -o mntent.o
    In file included from ../../../include/mntent.h:26,
    from mntent.c:4:
    ../../../include/paths.h:35: config/autoconf.h: No such file or directory
    make[5]: *** [mntent.o] Error 1
    make[5]: Leaving directory `/root/uClinux-dist/uClibc/libc/misc/mntent'
    make[4]: *** [_dir_mntent] Error 2
    make[4]: Leaving directory `/root/uClinux-dist/uClibc/libc/misc'
    make[3]: *** [_dir_misc] Error 2
    make[3]: Leaving directory `/root/uClinux-dist/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/root/uClinux-dist/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    A
    vi ./uClibc/include/paths.h
    35line:config/autoconf.h===>linux/autoconf.h
    ========================================================
    Q(uclib 0.9.28)
    arm-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -mlittle-endian -mtune=arm710 -march=armv3 -msoft-float -fno-builtin -nostdinc -D_LIBC -I../../include -I. -fstrict-aliasing -Os -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -DL___glibc_strerror_r wstring.c -c -o __glibc_strerror_r.o
    cc1: warning: -g with -fomit-frame-pointer may not give sensible debugging
    wstring.c:1574: `__glibc_strerror_r' undeclared here (not in a function)
    wstring.c:1574: warning: type defaults to `int' in declaration of `__strerror_r'
    wstring.c:1575: `__glibc_strerror_r' undeclared here (not in a function)
    wstring.c:1575: warning: type defaults to `int' in declaration of `_glibc_strerror_r'
    wstring.c:1575: `_glibc_strerror_r' redeclared as different kind of symbol
    ../../include/string.h:260: previous declaration of `_glibc_strerror_r'
    wstring.c: In function `__glibc_strerror_r':
    wstring.c:1579: warning: implicit declaration of function `__xpg_strerror_r'
    make[4]: *** [__glibc_strerror_r.o] Error 1
    make[4]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/string'
    make[3]: *** [_dir_string] Error 2
    make[3]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    debian:/opt/uClinux-dist#
    A
    use uClibc-0.9.27 same file name replace it
    -------------------------------------------------
    Q
    arm-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -mlittle-endian -mtune=arm710 -march=armv3 -msoft-float -fno-builtin -nostdinc -D_LIBC -I../../../../include -I. -fstrict-aliasing -Os -O2 -g -fomit-frame-pointer -fno-common -fno-builtin -Wall -DEMBED -isystem /usr/local/lib/gcc-lib/arm-elf/2.95.3/include -DNDEBUG -c syscall.c -o syscall.o
    cc1: warning: -g with -fomit-frame-pointer may not give sensible debugging
    syscall.c: In function `syscall':
    syscall.c:40: `__NR_syscall' undeclared (first use in this function)
    syscall.c:40: (Each undeclared identifier is reported only once
    syscall.c:40: for each function it appears in.)
    make[6]: *** [syscall.o] Error 1
    make[6]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps/linux/arm'
    make[5]: *** [arm] Error 2
    make[5]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps/linux'
    make[4]: *** [_dir_linux] Error 2
    make[4]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc/sysdeps'
    make[3]: *** [_dir_sysdeps] Error 2
    make[3]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc/libc'
    make[2]: *** [_dir_libc] Error 2
    make[2]: Leaving directory `/root/Desktop/uclinuxkernel/uClibc'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/uClinux-dist/lib'
    make: *** [lib_only] Error 2
    A
    /opt/uClinux-dist/uClibc/libc/sysdeps/linux/arm/syscal.c
    add include file:
    #include <asm-arm/unistd.h>

    Q config/autoconf.h: No such file or directory
    A #include <config/autoconf.h>=====>
    #include <linux/autoconf.h>
    ABOUT
    ./uClibc/include/paths.h
    ./uClibc/libc/sysdeps/linux/common/syscalls.c
    ------------------------------------------------

    Q
    romfs-inst.sh libpam/libpam.so /lib/libpam.so.0
    cp: cannot create regular file `/root/uClinux-dist/romfs/lib/libpam.so.0': No such file or directory
    make[2]: *** [romfs] Error 1
    A
    mkdir -p romfs/lib/
    ------------------------------------------------
    Q
    ioperm.c:104: `BUS_ISA_PORT_SHIFT' undeclared (first use in this function)
    ioperm.c:104: initializer element is not constant
    ioperm.c:104: (near initialization for `ioshift_name[2]')
    make[6]: *** [ioperm.o] Error 1
    make[6]: Leaving directory `/root/uClinux-dist/uClibc/libc/sysdeps/linux/arm'
    make[5]: *** [arm] Error 2
    A
    cd uClibc
    make menuconfig ARCH=armnommu CROSS=arm-elf-
    cd ..

    ------------------------------------------------
    Q
    arm-elf-ld -p -X -T arch/armnommu/vmlinux.lds arch/armnommu/kernel/head-armv.o arch/armnommu/kernel/init_task.o init/main.o init/version.o init/do_mounts.o /
    --start-group /
    arch/armnommu/kernel/kernel.o arch/armnommu/mm/mm.o arch/armnommu/mach-S3C44B0X/S3C44B0X.o kernel/kernel.o mmnommu/mmnommu.o fs/fs.o ipc/ipc.o /
    drivers/serial/serial.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/net/appletalk/appletalk.o drivers/media/media.o /
    net/network.o /
    arch/armnommu/lib/lib.a /root/uClinux-dist/linux-2.4.x/lib/lib.a /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a /
    --end-group /
    -o linux
    fs/fs.o(.data+0x1378): multiple definition of `romfs_file_operations'
    romfs.o(.data+0x80): first defined here
    make[1]: *** [linux] Error 1
    make[1]: Leaving directory `/root/uClinux-dist/linux-2.4.x'
    make: *** [linux] Error 1

    A
    vi ~/uClinux-dist/linux-2.4.x/fs/romfs/inode.c
    /* Mapping from our types to the kernel */

    static struct address_space_operations romfs_aops = {
    readpage: romfs_readpage
    };

    static struct file_operations romfs_dir_operations = {
    read: generic_read_dir,
    readdir: romfs_readdir,
    };

    static struct file_operations romfs_file_operations = {
    read: generic_file_read,
    mmap: generic_file_mmap,
    #ifdef MAGIC_ROM_PTR
    romptr: romfs_romptr,
    #endif
    ------------------------------------------------
    Q: I get the following error message:
    qc-driver.c:51: linux/version.h: No such file or directory
    qc-driver.c:52: parse error
    or
    .../include/linux/config.h:4: linux/autoconf.h: No such file or directory
    or
    sed: can't read /usr/src/linux/Makefile: No such file or directory
    or
    Makefile:26: /usr/src/linux/.config: No such file or directory

    A: You must install Linux kernel source code corresponding
    to the kernel you will be running with the camera driver.
    The source must be configured and depencies must have been
    created. Typically you can just install the kernel source
    package that comes with your distribution. If you're instead using
    virgin kernel in /usr/src/linux-x.y.zz, you must first copy
    kernel configuration file to /usr/src/linux-x.y.zz/.config,
    then go to the directory and run "make oldconfig" and "make dep".
    This should create the missing linux/version.h file.
    Some more help for Redhat/Mandrake users:

    If you get a lot of errors on mandrake or red hat when
    you do a make, it may be because you didn't install a
    full development version, meaning your kernel sources
    are not there.
    This worked for me

    urpmi kernel-source
    urpmi kernel-headers
    urpmi kernel-doc

    urpmi is your friend, it will find the CD that it needs
    to get this. Some rpms may be installed already, big
    deal, do this then do a make, it worked on mandrake 8.2!

    ------------------------------------------------------------
    Q: And finally, I look for /dev/video* (to set the videodev on
    gnomemeeting) and I haven't any videodevice.

    A:
    mknod /dev/video0 c 81 0
    chmod a+r /dev/video0
    ln -s /dev/video0 /dev/video

    ------------------------------------------------------------
    Q: quickcam.c:2099: too few arguments to function `remap_page_range_R2baf18f2'
    Damian Ivereigh posted a patch to be able to compile
    the driver for RedHat 9.0 but I don't know how to do
    A: Due to qc-usb 0.5.1, this should be now fixed. If you
    still encounter this problem, and
    if you're using qc-usb, just compile it with command
    USER_OPT=-DHAVE_VMA=1 make all
    Otherwise (if you're using older qce-ga):
    1. Download qce-ga-0.40d.tar.gz package and save
    the patch
    wget http://www.ee.oulu.fi/~tuukkat/quickcam/qce-gq-rh9.patch
    wget http://www.ee.oulu.fi/~tuukkat/quickcam/qce-ga-0.40d.tar.gz
    2. Extract the package:
    tar xvfz qce-ga-0.40d.tar.gz
    3. Enter the source directory
    cd qce-ga-0.40d
    4. Apply the patch:
    patch -s -p1 < ../qce-gq-rh9.patch
    5. patch complains that the patch is reversed. Answer yes:
    Reversed (or previously applied) patch detected! Assume -R? [n] y
    6. Then compile and install the driver normally
    make
    ./quickcam.sh

    ------------------------------------------------------------
    Q: I don't have permissions for /dev/video?
    A: Easiest way to add permissions is to do
    chmod a+rw /dev/video?
    as root. Altenatively, especially on Debian, users belonging
    to the "video" group can access video devices. In this case,
    you might instead prefer issuing
    addgroup <yourlogin> video
    as root and then login as normal user. Check in which groups
    your are in with
    id -a

    ------------------------------------------------------------
    Q: My log files keep filling up (but the driver works fine)!
    A: use "qcset debug=0" to disable all possible messages.
    If it doesn't help, send e-mail to mailing lists showing
    the exact error message that fills your logs.
    (especially "frame lost" message is uninteresting, it is
    known to happen with some programs and will be fixed later.

    ------------------------------------------------------------
    Q: quickcam.o: kernel-module version mismatch
    quickcam.o was compiled for kernel version 2.4.18
    while this kernel is version 2.4.18-686-smp.
    A: Then edit "Makefile" in the kernel source directory and change the line 4
    from
    EXTRAVERSION =
    to
    EXTRAVERSION = -686-smp
    --or if this doesn't help--
    Go to /usr/src/linux-2.4/include/linux/version.h and change the
    UTS_RELEASE to match the output of "uname -r" on the command line
    (should be 2.4.18-686-smp). Then recompile the module and then the
    insmod will work perfectly :) [from Mark]

    ------------------------------------------------------------
    Q: I want to reverse engineer an USB camera. How?
    A: Run *ugh* Windoze *cough* drivers with a USB stream
    capture program, like http://sourceforge.net/projects/usbsnoop/
    Then send the same commands to the camera from Linux.

    ------------------------------------------------------------
    Q: I added IEEE1394 card and now Quickcam doesn't work?
    A: The card driver overwrites /dev/video0..2, use
    insmod ./quickcam.o video_nr=3
    and then /dev/video3 with Quickcam.
    Create /dev/video3 with mknod if necessary.
    (from Makarand)
    -------------------------------------------------------------
    Error:
>make[2]: Entering directory `/opt/uClinux-dist/uClibc'
>Rules.mak:25: Config: No such file or directory
>You didn't read the README, did you... =)
>Choose a configuration file in extras/Config/ and then run
> ln -s ./extra/Configs/Config.<arch> ./Config

    A: The solution to this seems obvious. I "cp ./vendors/Lineo/uCdimm/config.uClibc
    ./vendors/Lineo/uCsimm" and make again with the same settings as above. The
    library compile bombs out a little further along...
    ------------------------------------------------
    Q
>m68k-elf-gcc -Wall -fno-builtin -nostdinc -m68000 -nostdinc
> -I../../../../include
> -I/usr/local/lib/gcc-lib/m68k-elf/2.95.3/include -I.
> -D_LIBC -m68000 -O2 -g -fomit-frame-pointer -DCONFIG_LINEO
> -fno-builtin -msep-data -DEMBED
> -I/opt/uClinux-dist/lib/uClibc/include -I/opt/uClinux-dist
> -Dlinux -D__linux__ -D__uClinux__ -Dunix
> -I/opt/uClinux-dist/linux-2.4.x/include -DNDEBUG
> -DL_ioperm syscalls.c -c -o ioperm.o
>syscalls.c:767: sys/io.h: No such file or directory
>make[6]: *** [ioperm.o] Error 1

    A
    recent posting suggests a solution. Rather than copy individual missing files,
    I untared an older uClibc-snapshot into "./uClibc" and then overcopied with the
    uClibc-0.9.10 tree. The make goes further still and stops with...
    use the uClib of uClinux-dist-20050311.tar.gz replace it,because I can make it in that.
    -----------------------------------------------------
    Q
>m68k-elf-gcc -Wall -fno-builtin -c crti.S -o crti.o
>cp crti.o ../../../../lib/
>cp: cannot create regular file
> `../../../../lib/crti.o': No such file or directory
>make[6]: *** [crti.o] Error 1

    A
    Now I'm lost. I made a wild guess which is probably wrong and created a
    directory called ./uClibc/lib and recompiled...
    ------------------------------------------------
    Q
>make[6]: Entering directory
> `/opt/uClinux-dist/uClibc/libc/sysdeps/linux/m68k'
>m68k-elf-gcc -Wall -fno-builtin -nostdinc -m68000
> -nostdinc -I../../../../include
> -I/usr/local/lib/gcc-lib/m68k-elf/2.95.3/include -I.
> -D_LIBC -m68000 -O2 -g -fomit-frame-pointer -DCONFIG_LINEO
> -fno-builtin -msep-data -DEMBED
> -I/opt/uClinux-dist/lib/uClibc/include -I/opt/uClinux-dist
> -Dlinux -D__linux__ -D__uClinux__ -Dunix
> -I/opt/uClinux-dist/linux-2.4.x/include -DNDEBUG -c __longjmp.S
> -o __longjmp.o
>../../../../include/bits/setjmp.h: Assembler messages:
>../../../../include/bits/setjmp.h:25: Error:
> Unknown operator -- statement `typedef struct' ignored
    etc

    A
    My host system is RH7.2 and I've installed m68k-elf-tools-20020218.tar.gz under
    "/" and uClinux-dist-20020306.tar.gz under "/opt".
    ------------------------------------------------------------
    Q
    /bin/sh: ucfront-gcc: command not found
    A
    /*intrenet A
    I think you have'nt installed the toolchain properly.
    Simply type arm-linux-gcc in one linux console.
    if still gives the error "command not found",reinstall
    the toolchain.
    If it still doesn't work, you may have to modify the
    PATH environmental varaiable to include the
    toolchain's path to it.*/
    My methods:
    1 vi ./tools/ucfront/Makefile

    HOSTCC ?= cc

    SRC=ucfront.c args.c util.c execute.c vasprintf.c

    ucfront: $(SRC)
    $(HOSTCC) -g -Werror -m32 -Wall -DHAVE_MKSTEMP -o $@ $(SRC)

    clean:
    $(RM) -f *.o ucfront core tags

    ucfront.1: ucfront.yo
    -yodl2man -o ucfront.1 ucfront.yo
    2. cd ./tools/ucfront/; make;cd ../..
    ----------------------------------------------
    Q
    arch/armnommu/lib/lib.a /root/uClinux-dist/linux-2.4.x/lib/lib.a /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a /
    --end-group /
    -o linux
    /usr/local/bin/arm-elf-ld.real: cannot open romfs.o: No such file or directory
    make[1]: *** [linux] Error 1

    A
    cp ./linux-2.4.x/fs/romfs/romfs.o ./linux-2.4.x/


    ===============================================

    参考文档:

    1.http://www.ee.oulu.fi/~tuukkat/quickcam/FAQ
 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值