"Mehmet Akif Antepli" <akifante...@gmail.com> wrote:

> Even tough, I have included correct path  for the header "libusb.h" and
> `libusb-1.0.a` and linked the static library with the command "-lusb-1.0",
> when I try to build my c++ project, I get "undefined reference to
> `libusb_<xxx>" errors (xxx is any function called from the libusbx)

Do you also have 'libusb-1.0.dll.a' in that same directory? I.e. the import
lib. And are you aware of the contorted logic behind the ld search for libs?
>From the ld manual:

  [...] when ld is called with the argument `-lxxx' it will attempt to
  find, in the first directory of its search path,

    libxxx.dll.a
    xxx.dll.a
    libxxx.a
   etc.

before moving on to the next directory in the search path.

So yes, what you see could be expected behavior.
Better use explicit linking.  I.e. <libusbx-root>/lib/libusb-1.0.a.

Exactly what is the command to link your C++ project?

--gv

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to