This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Libraries: libusb question


On 2017-06-22 05:09 -0700, MikeSD wrote:
> My question concerns usblib. Can't seem to figure out how to install and use
> it with my system and I need usb functions.  

This is off the topic of gcc-help.

> I'm using CodeBlocks (IDE) and installed it with
> "codeblocks-16.01mingw-setup.exe" so it came with this gcc compiler.  I'm
> using C and C++.  The installation installed properly and I can write,
> compile and execute programs with what came with it.  However, I need a
> library (usblib) that isn't included and can't seem to figure out how to get
> it installed and working.
> 
> I need some specific, detailed instructions.  And if possible, I'd like to
> be able to do this, without having to install Cygwin.  And when I say
> detailed, I mean detailed.  I'm kind of a bonehead when it comes to tool
> chains.
> 
> And my system is a Windows based system, using Windows 7, 64 bit version.
> 
> 1) Simple solution would be if there is a libusb library, that is already
> compiled for windows 7, 64bit, that I can just add the libusb.a library to
> my system, with the proper usblib.h file. Does one exist?

I think you may get one from MinGW or MSYS.

> 2) I've downloaded 
>   a) libusb-1.0.9 (2012-04-20) 
>   b) libusb-compat-0.1.4 (2012-04-24) 
> 
> from libusb.org, but the first doesn't include the compiled library
> (libusb.a) and the 2nd does include multiple libraries and multiple header
> files but I can't find any combination that works.  So, I obviously must not
> understand something about this.  Is one of these two, what I should be
> using?  Which one, for my system?

Of course the first doesn't contain compiled libusb.a.  It's a source code
tarball.  You need GNU bash to run its configure script, which is not included
in codeblocks-mingw.

> 3) Will I need a 64 bit version of libusb, for my system?

Both 32-bit and 64-bit version would work.

> 4) What is the step by step operation to get libusb, onto my windows 7, 64
> bit system, using codeblocks and the mingw-setup?  Assume I know nothing and
> you'll be very close to my experience level with tool-chains. ;)

The most convenient way is to use MinGW or MSYS.  If you really want to compile
a package yourself, get GNU bash, GNU make and GCC from MinGW/MSYS at first. Then
just follow the package's INSTALL file.

> I do sort of understand the basics but getting wrapped around the axel on
> something.  I do know that I have to put a library in one of my folders, and
> add it to my IDE (for my project). And I know I have to point the linker to
> my library.  But when I do all this, I still get errors, as if I have the
> wrong header or wrong library/header mismatch.  Need some specific help,
> with specific packages to use, and such.  

How did Codeblocks invoke GCC?  What did GCC or ld complain?  If you don't tell
us, we can't help.

> Thanks,
> Mike
> 
> 
> 
> 
> 
> --
> View this message in context: http://gcc.1065356.n8.nabble.com/Libraries-libusb-question-tp1386241.html
> Sent from the gcc - Help mailing list archive at Nabble.com.
-- 
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]