Abhishek Thayyil
Abhishek Thayyil

Reputation: 91

error LNK2028: unresolved token (0A000040) "extern "C

am new to the world of C++ until now i was doin only java ,i have an application in which am implementing some of the functionalities of libusb.h, when i run build the appliction an error comes out as shown below

1>AOA.obj : error LNK2028: unresolved token (0A000040) "extern "C" int __stdcall libusb_get_config_descriptor(struct libusb_device *,unsigned char,struct libusb_config_descriptor * *)" (?libusb_get_config_descriptor@@$$J212YGHPAUlibusb_device@@EPAPAUlibusb_config_descriptor@@@Z) referenced in function "private: int __stdcall AOA::findEndPoint(struct libusb_device *)" (?findEndPoint@AOA@@$$FAAGHPAUlibusb_device@@@Z)

Thanks.

Upvotes: 1

Views: 1794

Answers (1)

Werner Henze
Werner Henze

Reputation: 16771

You need to link against libusb. You should add -lusb to the gcc call. You might need to add -Lpath_to_libusb before -lusb.

Maybe you better should start with a given sample program like that one?

Upvotes: 1

Related Questions