Find the answer to your Linux question:
Results 1 to 2 of 2
hi to all, i started sample driver in suse linux10.1 and the following is the gcc command to compile the simple helloworld program gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -O2 -Wall -I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41

    Arrow problem in compiling a sample driver


    hi to all, i started sample driver in suse linux10.1 and the following is the gcc command to compile the simple helloworld program

    gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -O2 -Wall -I /usr/src/linux/include -o client3.o -c client3.c

    but ended with the following errors please can anyone help me to get rid of these errors.thank you


    client3.c:227:1: warning: "MODULE" redefined
    <command line>:1:1: warning: this is the location of the previous definition
    In file included from /usr/src/linux/include/asm/processor.h:18,
    from /usr/src/linux/include/asm/thread_info.h:17,
    from /usr/src/linux/include/linux/thread_info.h:21,
    from /usr/src/linux/include/linux/preempt.h:10,
    from /usr/src/linux/include/linux/spinlock.h:50,
    from /usr/src/linux/include/linux/capability.h:45,
    from /usr/src/linux/include/linux/sched.h:7,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/system.h: In function ‘__set_64bit_var’:
    /usr/src/linux/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    /usr/src/linux/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    In file included from /usr/src/linux/include/linux/rwsem.h:27,
    from /usr/src/linux/include/asm/semaphore.h:42,
    from /usr/src/linux/include/linux/sched.h:20,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/rwsem.h: In function ‘__down_read’:
    /usr/src/linux/include/asm/rwsem.h:106: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/rwsem.h: In function ‘__down_write’:
    /usr/src/linux/include/asm/rwsem.h:158: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/rwsem.h: In function ‘__up_read’:
    /usr/src/linux/include/asm/rwsem.h:195: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/rwsem.h:189: warning: unused variable ‘tmp’
    /usr/src/linux/include/asm/rwsem.h: In function ‘__up_write’:
    /usr/src/linux/include/asm/rwsem.h:221: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/rwsem.h: In function ‘__downgrade_write’:
    /usr/src/linux/include/asm/rwsem.h:246: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    In file included from /usr/src/linux/include/linux/sched.h:20,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/semaphore.h: In function ‘down’:
    /usr/src/linux/include/asm/semaphore.h:105: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/semaphore.h: In function ‘down_interruptible’:
    /usr/src/linux/include/asm/semaphore.h:130: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/semaphore.h: In function ‘down_trylock’:
    /usr/src/linux/include/asm/semaphore.h:155: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux/include/asm/semaphore.h: In function ‘up’:
    /usr/src/linux/include/asm/semaphore.h:179: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    In file included from /usr/src/linux/include/asm/smp.h:18,
    from /usr/src/linux/include/linux/smp.h:19,
    from /usr/src/linux/include/linux/sched.h:26,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/mpspec.h:6:25: error: mach_mpspec.h: No such file or directory
    In file included from /usr/src/linux/include/asm/smp.h:18,
    from /usr/src/linux/include/linux/smp.h:19,
    from /usr/src/linux/include/linux/sched.h:26,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/mpspec.h: At top level:
    /usr/src/linux/include/asm/mpspec.h:8: error: ‘MAX_MP_BUSSES’ undeclared here (not in a function)
    /usr/src/linux/include/asm/mpspec.h:23: error: ‘MAX_IRQ_SOURCES’ undeclared here (not in a function)
    In file included from /usr/src/linux/include/linux/smp.h:19,
    from /usr/src/linux/include/linux/sched.h:26,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/smp.h:77:26: error: mach_apicdef.h: No such file or directory
    In file included from /usr/src/linux/include/linux/smp.h:19,
    from /usr/src/linux/include/linux/sched.h:26,
    from /usr/src/linux/include/linux/module.h:10,
    from client3.c:229:
    /usr/src/linux/include/asm/smp.h: In function ‘hard_smp_processor_id’:
    /usr/src/linux/include/asm/smp.h:81: warning: implicit declaration of function ‘GET_APIC_ID’

  2. #2
    Just Joined!
    Join Date
    Jan 2005
    Location
    Idaho
    Posts
    35
    I can't help you with that exactly, but is it possible you might get more/better response in the suse section instead of arch?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •