Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 03-10-2006, 08:45 AM   #1
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 */
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;
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, 10:46 PM   #2
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.


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

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

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