LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2005, 09:57 AM   #1
barry2811
LQ Newbie
 
Registered: Jun 2005
Distribution: Mandrake 10.2
Posts: 3

Rep: Reputation: 0
Compiling Joystick Driver


I'm trying to compile the joystick driver. I'm using Mandrake 10.2 and I've installed the kernel source from CD3. However, when I try to make the joystick driver I get the following error;

Code:
gcc -O2 -Wall -pipe -m486 -fomit-frame-pointer -I. -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -c joystick.c -o joystick.o
In file included from /usr/include/linux/sched.h:14,
                 from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/linux/cpumask.h:81: error: syntax error before "DECLARE_BITMAP"
/usr/include/linux/cpumask.h:82: error: syntax error before "_unused_cpumask_arg_"
/usr/include/linux/cpumask.h:85: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpu_set':
/usr/include/linux/cpumask.h:87: error: `cpu' undeclared (first use in this function)
/usr/include/linux/cpumask.h:87: error: (Each undeclared identifier is reported only once
/usr/include/linux/cpumask.h:87: error: for each function it appears in.)
/usr/include/linux/cpumask.h:87: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:91: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpu_clear':
/usr/include/linux/cpumask.h:93: error: `cpu' undeclared (first use in this function)
/usr/include/linux/cpumask.h:93: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:97: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_setall':
/usr/include/linux/cpumask.h:99: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:99: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:103: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_clear':
/usr/include/linux/cpumask.h:105: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:105: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:112: error: syntax error before "cpumask_t"
/usr/include/linux/cpumask.h: In function `__cpu_test_and_set':
/usr/include/linux/cpumask.h:114: error: `cpu' undeclared (first use in this function)
/usr/include/linux/cpumask.h:114: error: `addr' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:118: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_and':
/usr/include/linux/cpumask.h:121: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:121: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:121: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:121: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:125: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_or':
/usr/include/linux/cpumask.h:128: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:128: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:128: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:128: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:132: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_xor':
/usr/include/linux/cpumask.h:135: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:135: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:135: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:135: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:140: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_andnot':
/usr/include/linux/cpumask.h:143: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:143: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:143: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:143: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:147: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_complement':
/usr/include/linux/cpumask.h:150: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:150: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:150: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:154: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_equal':
/usr/include/linux/cpumask.h:157: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:157: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:157: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:161: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_intersects':
/usr/include/linux/cpumask.h:164: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:164: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:164: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:168: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_subset':
/usr/include/linux/cpumask.h:171: error: `src1p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:171: error: `src2p' undeclared (first use in this function)
/usr/include/linux/cpumask.h:171: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:175: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_empty':
/usr/include/linux/cpumask.h:177: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:177: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:181: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_full':
/usr/include/linux/cpumask.h:183: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:183: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:187: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_weight':
/usr/include/linux/cpumask.h:189: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:189: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:194: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_shift_right':
/usr/include/linux/cpumask.h:197: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:197: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:197: error: `n' undeclared (first use in this function)
/usr/include/linux/cpumask.h:197: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:202: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpus_shift_left':
/usr/include/linux/cpumask.h:205: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:205: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:205: error: `n' undeclared (first use in this function)
/usr/include/linux/cpumask.h:205: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:209: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__first_cpu':
/usr/include/linux/cpumask.h:211: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h:211: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:215: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__next_cpu':
/usr/include/linux/cpumask.h:217: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h:217: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:217: error: `n' undeclared (first use in this function)
In file included from /usr/include/linux/sched.h:14,
                 from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/linux/cpumask.h:234:5: missing binary operator before token "("
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:266: error: syntax error before '*' token
/usr/include/linux/cpumask.h: In function `__cpumask_scnprintf':
/usr/include/linux/cpumask.h:268: error: `buf' undeclared (first use in this function)
/usr/include/linux/cpumask.h:268: error: `len' undeclared (first use in this function)
/usr/include/linux/cpumask.h:268: error: `srcp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:268: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:274: error: syntax error before "cpumask_t"
/usr/include/linux/cpumask.h: In function `__cpumask_parse':
/usr/include/linux/cpumask.h:276: error: `buf' undeclared (first use in this function)
/usr/include/linux/cpumask.h:276: error: `len' undeclared (first use in this function)
/usr/include/linux/cpumask.h:276: error: `dstp' undeclared (first use in this function)
/usr/include/linux/cpumask.h:276: error: `nbits' undeclared (first use in this function)
/usr/include/linux/cpumask.h:279:5: missing binary operator before token "("
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:344: error: syntax error before "cpu_possible_map"
/usr/include/linux/cpumask.h:345: error: syntax error before "cpu_online_map"
/usr/include/linux/cpumask.h:346: error: syntax error before "cpu_present_map"
/usr/include/linux/cpumask.h:348:5: missing binary operator before token "("
In file included from /usr/include/linux/list.h:7,
                 from /usr/include/linux/wait.h:23,
                 from /usr/include/asm/semaphore.h:41,
                 from /usr/include/linux/sched.h:18,
                 from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/linux/prefetch.h: In function `prefetch_range':
/usr/include/linux/prefetch.h:64: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared (first use in this function)
In file included from /usr/include/asm/siginfo.h:4,
                 from /usr/include/linux/signal.h:7,
                 from /usr/include/linux/sched.h:26,
                 from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/asm-generic/siginfo.h: At top level:
/usr/include/asm-generic/siginfo.h:59: error: size of array `_pad' is too large
In file included from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/linux/sched.h:160: error: syntax error before "nohz_cpu_mask"
In file included from /usr/include/linux/module.h:9,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/linux/sched.h:241: error: syntax error before "cpumask_t"
/usr/include/linux/sched.h:262: error: syntax error before '}' token
/usr/include/linux/sched.h:553: error: syntax error before "cpumask_t"
/usr/include/linux/sched.h:577: error: syntax error before ':' token
/usr/include/linux/sched.h:617: error: syntax error before ':' token
/usr/include/linux/sched.h:695: error: syntax error before '}' token
/usr/include/linux/sched.h: In function `process_group':
/usr/include/linux/sched.h:699: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `pid_alive':
/usr/include/linux/sched.h:712: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:774: error: syntax error before "cpumask_t"
/usr/include/linux/sched.h: In function `set_cpus_allowed':
/usr/include/linux/sched.h:776: error: `new_mask' undeclared (first use in this function)
/usr/include/linux/sched.h: In function `dequeue_signal_lock':
/usr/include/linux/sched.h:877: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:879: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `on_sig_stack':
/usr/include/linux/sched.h:919: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:919: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `sas_ss_flags':
/usr/include/linux/sched.h:924: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `capable':
/usr/include/linux/sched.h:935: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:936: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `mmdrop':
/usr/include/linux/sched.h:956: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:973: error: 'exit_signal' redeclared as different kind of symbol
/usr/include/linux/sched.h:573: error: previous declaration of 'exit_signal' was here
/usr/include/linux/sched.h: In function `thread_group_empty':
/usr/include/linux/sched.h:1037: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `task_lock':
/usr/include/linux/sched.h:1055: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `task_unlock':
/usr/include/linux/sched.h:1060: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `set_tsk_thread_flag':
/usr/include/linux/sched.h:1068: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `clear_tsk_thread_flag':
/usr/include/linux/sched.h:1073: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `test_and_set_tsk_thread_flag':
/usr/include/linux/sched.h:1078: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `test_and_clear_tsk_thread_flag':
/usr/include/linux/sched.h:1083: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `test_tsk_thread_flag':
/usr/include/linux/sched.h:1088: error: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:1191: error: syntax error before "cpumask_t"
/usr/include/linux/sched.h:1192: error: syntax error before "cpumask_t"
In file included from /usr/include/linux/module.h:22,
                 from ./linux/joystick.h:33,
                 from joystick.c:40:
/usr/include/asm/module.h:58:2: #error unknown processor family
In file included from ./linux/joystick.h:131,
                 from joystick.c:40:
/usr/include/linux/version.h:2:2: #error "======================================================="
/usr/include/linux/version.h:3:2: #error "You should not include /usr/include/{linux,asm}/ header"
/usr/include/linux/version.h:4:2: #error "files directly for the compilation of kernel modules."
/usr/include/linux/version.h:5:2: #error ""
/usr/include/linux/version.h:6:2: #error "glibc now uses kernel header files from a well-defined"
/usr/include/linux/version.h:7:2: #error "working kernel version (as recommended by Linus Torvalds)"
/usr/include/linux/version.h:8:2: #error "These files are glibc internal and may not match the"
/usr/include/linux/version.h:9:2: #error "currently running kernel. They should only be"
/usr/include/linux/version.h:10:2: #error "included via other system header files - user space"
/usr/include/linux/version.h:11:2: #error "programs should not directly include <linux/*.h> or"
/usr/include/linux/version.h:12:2: #error "<asm/*.h> as well."
/usr/include/linux/version.h:13:2: #error ""
/usr/include/linux/version.h:14:2: #error "To build kernel modules please do the following:"
/usr/include/linux/version.h:15:2: #error ""
/usr/include/linux/version.h:16:2: #error " o Have the kernel sources installed"
/usr/include/linux/version.h:17:2: #error ""
/usr/include/linux/version.h:18:2: #error " o Make sure that the symbolic link"
/usr/include/linux/version.h:19:2: #error "   /lib/modules/`uname -r`/build exists and points to"
/usr/include/linux/version.h:20:2: #error "   the matching kernel source directory"
/usr/include/linux/version.h:21:2: #error ""
/usr/include/linux/version.h:22:2: #error " o Now copy /boot/vmlinuz.version.h to"
/usr/include/linux/version.h:23:2: #error "   /lib/modules/`uname -r`/build/include/linux/version.h"
/usr/include/linux/version.h:24:2: #error ""
/usr/include/linux/version.h:25:2: #error " o When compiling, make sure to use the following"
/usr/include/linux/version.h:26:2: #error "   compiler option to use the correct include files:"
/usr/include/linux/version.h:27:2: #error ""
/usr/include/linux/version.h:28:2: #error "   -I/lib/modules/`uname -r`/build/include"
/usr/include/linux/version.h:29:2: #error ""
/usr/include/linux/version.h:30:2: #error "   instead of"
/usr/include/linux/version.h:31:2: #error ""
/usr/include/linux/version.h:32:2: #error "   -I/usr/include/linux"
/usr/include/linux/version.h:33:2: #error ""
/usr/include/linux/version.h:34:2: #error "   Please adjust the Makefile accordingly."
/usr/include/linux/version.h:35:2: #error "======================================================="
In file included from joystick.c:40:
./linux/joystick.h:133:40: missing binary operator before token "("
./linux/joystick.h:137:40: missing binary operator before token "("
./linux/joystick.h:174:40: missing binary operator before token "("
joystick.c:43:26: linux/malloc.h: No such file or directory
In file included from joystick.c:44:
/usr/include/linux/mm.h: In function `can_do_mlock':
/usr/include/linux/mm.h:568: error: dereferencing pointer to incomplete type
joystick.c: In function `js_read':
joystick.c:285: error: dereferencing pointer to incomplete type
joystick.c:305: error: dereferencing pointer to incomplete type
joystick.c: In function `js_open':
joystick.c:516: error: `MOD_INC_USE_COUNT' undeclared (first use in this function)
joystick.c: In function `js_release':
joystick.c:575: error: `MOD_DEC_USE_COUNT' undeclared (first use in this function)
make: *** [joystick.o] Error 1
Anyone have any ideas on this?
 
Old 06-04-2005, 02:49 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Hi!

What kind of joypad/stick do you have?. Because I've had nothing but good experiences with Linux and USB joypads out of the box. I use myself a PS2 joypad with an USB adapter. All I had to do is to load the correct modules. E.g:

su -
modproble joydev


Then, to test your joypad, type cat /dev/js0 and press a few buttons on your joypad. If some "garbage/weird" characters are displayed on your terminal, then you know your pad is working

Good luck!
 
Old 06-04-2005, 08:48 AM   #3
barry2811
LQ Newbie
 
Registered: Jun 2005
Distribution: Mandrake 10.2
Posts: 3

Original Poster
Rep: Reputation: 0
It's a sidewinder on the gameport. Once I got my gameport recognised correctly then I did the cat /dev/input/js0 and it seemed to work fine. I can't get it to work with xMAME though. It doesn't show in the list of the devices (only keyboard and mouse do). I guess my problem might be related to xMAME now then.

Thanks.
 
Old 06-04-2005, 12:00 PM   #4
barry2811
LQ Newbie
 
Registered: Jun 2005
Distribution: Mandrake 10.2
Posts: 3

Original Poster
Rep: Reputation: 0
Got it going now. Re-compiled xMAME commenting out the X11_JOYNAME line and then used the jdev argument to pass /dev/input/js to xMAME at run-time and my sidewinder is detected.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling driver files AngryDwarf Linux - Hardware 1 09-28-2005 07:05 AM
Compiling driver into kernel DDoS YourseLF Linux - General 1 08-07-2005 01:45 PM
Joystick Driver and API under kernel 2.6.12.3 using an USB joystick dispatcher Linux - Newbie 1 08-06-2005 09:43 AM
How to install a generic joystick driver on SBLIVE/Debian muadib Linux - Hardware 4 01-28-2005 02:29 PM
compiling video driver, tell me if this is right bosewicht Linux - Newbie 2 09-29-2003 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration