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
This goes back to what I recommended about not moving files; 'usb.h' is
expecting to find a subdirectory 'linux', with two dependent include files,
one of which is "linux/mod_devicetable.h".
Include files frequently (almost always) refer to other include files. The
most generic ones are in '/usr/include' and '/usr/local/include'. From
there, they start getting OS, version, and product/project specific. Version
3 of gcc has it's own subfolder under /usr/include, for example.
Find 'linux/mod_devictable.h' on your file system. Instead of moving it, add
the directory to your compile statement. Example (<somewhere is the
directory that has the 'linux' subdirectory containing 'mod_devicetable.h'):
gcc iUSBDaqexample.c -I /usr/include -I /<somewhere -o example.out.
This will likely turn up more include file dependencies. Look at the build
error for the "missing file or include path", keep adding the referenced
file location to your include path. Eventually, it will all compile but not
link. Let me know when you get there ;/)
--Kenny A.
http://websites.expercraft.com/kennya/
OK Kenny I get it now. I think. One xx.h calls another yy.h someplace else and that
one calls another someplace else and so on and so on. How do you guys
get anything done? This is a nightmare :)
Does it always look in the previous directory?
Why don't they put them all in the same directory?
I redirected the output of locate:
locate usb.h > locate-usb.h.txt
Then I converted it to a pdf so I could send it to you.
Here is the 3 page pdf file attached.
How do you know what path to choose? usb.h is all over the place.
I took a guess. Then I ran:
gcc -I "root/usr/src/linux-headers-2.6.28-17/include/linux/usb.h"
iUSBDAQsample.c -o usbtest
The results are shown in 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.