Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing IOUSBHIDDriver From Claiming a Device



> One other question.  I am getting a strange problem when trying to link
> libusb statically:
> 
> gcc -o tcpusb tcpusb.c -g -lm -I./include/  -lpthread -lm -DDEBUG -framework
IOKit -static -lusb
> ..
> warnings, etc.
> ..
> ld: can't locate file for: -lcrt0.o

Don't link the entire thing staticly; that's a bad idea for the reasons
already pointed out.     If your goal is to be able to provide a binary
without sending people to fetch and/or build third party libraries, link just
the libusb library staticly.



The pertinent line from GPSBabel's build process may inspire you as it does
this for both expat and libusb:

        make LIBEXPAT=/sw/lib/libexpat.a EXTRA_CFLAGS="-I/sw/include"
LIBUSB="/sw/lib/libusb.a -lIOKit  -lBSDPClient -framework CoreFoundation"

The punchline is to explictly include libusb.a in the link line.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.