LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-10-2006, 07:45 AM   #1
Librason
LQ Newbie
 
Registered: Mar 2006
Posts: 1

Rep: Reputation: 0
libusb compiler error, Help!!!


i test a .c file as follows:

#include <usb.h>
#include <stdio.h>

#define VENDOR_ID 0xE461
#define PRODUCT_ID 0x0007

usb_dev_handle *open_dev(void) {
struct usb_bus *busses;
struct usb_bus *bus;
struct usb_device *dev;

/* Find the device */
usb_init();
usb_find_busses();
usb_find_devices();
busses = usb_get_busses();

for (bus=busses; bus; bus=bus->next) {
for (dev=bus->devices; dev; dev=dev->next) {
if (dev->descriptor.idVendor == VENDOR_ID &&
dev->descriptor.idProduct == PRODUCT_ID) {
return usb_open(dev);
}
}
}
printf("No device found\n");
return NULL;
}

int main(int argc, char **argv) {
usb_dev_handle *d;
int i;

if (!(d = open_dev())) {
printf("Error opening device\n");
return 1;
}
else
{
printf("VendorID = %04X; ProductID = %04X\n",
d->device->descriptor.idVendor, d->device->descriptor.idProduct);

}
...
return (0);
}

when i compile it, i have a error:
dereferencing pointer to incomplete type

I don't know where is the mistake.
 
Old 03-10-2006, 09:46 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
libusb compile error gabyx Programming 10 03-24-2010 04:38 AM
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
compile error libusb hazeposse Programming 1 02-14-2006 03:22 PM
in gcc compiler error: parse error before string constsnt cynthia_thomas Linux - Networking 1 10-20-2005 01:29 AM
error while loading shared libraries: libusb-0.1.4 Ross Clement Fedora 2 11-10-2004 10:53 AM


All times are GMT -5. The time now is 01:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration