Subject: mor. c help needed]
From: Rotary Engine
Date: 1/17/2010, 11:39 PM
To: AAA Put this in the To box


 I am having a heck of a time.
 I now have usb.h in the same directory as
 stdio.h

 And it still does not compile.

 It appears the program iUSBDAQsample.c was written for a different
 compiler. Either that or the error messages are totally
 unrelated.

 paul@paul-desktop:~$ gcc iUSBDAQsample.c -o usbtest
 In file included from iUSBDAQ.h:36,
                 from iUSBDAQsample.c:36:
 /usr/include/usb.h:4:35: error: linux/mod_devicetable.h: No such file or
 directory
 In file included from iUSBDAQsample.c:36:
 iUSBDAQ.h:79: error: expected declaration specifiers or ?...? before
 ?usb_dev_handle?
 iUSBDAQ.h:81: error: expected ?)? before ?*? token
 iUSBDAQ.h:83: error: expected ?)? before ?*? token
 iUSBDAQ.h:86: error: expected ?)? before ?*? token
 iUSBDAQ.h:90: error: expected ?)? before ?*? token
 iUSBDAQ.h:93: error: expected ?)? before ?*? token
 iUSBDAQ.h:100: error: expected ?)? before ?*? token
 iUSBDAQ.h:108: error: expected ?)? before ?*? token
 iUSBDAQ.h:110: error: expected ?)? before ?*? token
 iUSBDAQ.h:114: error: expected ?)? before ?*? token
 iUSBDAQ.h:116: error: expected ?)? before ?*? token
 iUSBDAQ.h:118: error: expected ?)? before ?*? token
 iUSBDAQ.h:120: error: expected ?)? before ?*? token
 iUSBDAQ.h:122: error: expected ?)? before ?*? token
 iUSBDAQ.h:124: error: expected ?)? before ?*? token
 iUSBDAQ.h:126: error: expected ?)? before ?*? token
 iUSBDAQsample.c: In function ?main?:
 iUSBDAQsample.c:73: error: ?usb_dev_handle? undeclared (first use in this
 function)
 iUSBDAQsample.c:73: error: (Each undeclared identifier is reported only once
 iUSBDAQsample.c:73: error: for each function it appears in.)
 iUSBDAQsample.c:73: error: ?dev? undeclared (first use in this function)
 iUSBDAQsample.c:74: error: too many arguments to function
 ?iUSBDAQ_OpenDevice?



 Here is the files in question in pdf in case your isp does not
 like zipper. Also I changed the font because some systems will
 have trouble with bold. Computers are getting harder to use.

 Unbuntu is a nanny OS as it will not let you become root :)

 Paul Lamar

It's important to read C compiler errors from top to bottom.  Don't
even bother reading the lower messages until you understand and
correct the upper ones.  Follow the line numbers listed in the errors.

So, it appears to me that you are missing linux/mod_devicetable.h -
line 4 of usb.h includes it.  That's the first error.

The messages above that are there you help find why the compiler ran
into an error - USBDAQ.h line 36 inlcudes USBDAQSample.h.  Line 36 of
USBDAQSample includes USB.h.  Line 4 of usb.h attempts to include
linux/mod_devicetable.h which apparently doesn't exist anywhere that
the compiler knows to look for it.

It's very useful to use an editor that readily displays the line
number that the cursor is on.  Vim (vi, gvim) and emacs (xemacs) do
this directly.


Matt-

mod_devicetable.h is in the same directory I chose for usb.h

See the attached jpg.

Paul Lamar

-- 
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site. http://www.rotaryeng.net
Youtube key word UTUBPLEASE
Copyright 1998-2009 All world wide rights reserved.