Hi Jan, thanks for your input even though its not directly a USB issue.
I've just (as I write this) successfully compiled my eclipse project). Long story short I was actually correctly adding the -lusb linker command, and also correctly adding the path to the library files. But,...... lesson to oneself, don't add “-lusb” to the libraries section within C++ build settings, but leave out the “-l” in other words add it as “usb” or “usb-1.0”, it seems the “-l” is added internally. At least this is what worked.
Who knew? not me.
BTW:
The error was,
../src/generic_hid.cpp:78: undefined reference to `libusb_init'
and the same type of error for all libusb function your example uses.
Let me know if you want me to elaborate on my steps taken.
Cheers
m.b