Greetings,
I have a basic issue with configuring the lastest libusb to work under Visual Studio 2008, with a Windows 7 64-bit. I installed the libusb-win32 driver for my device.
I downloaded the libusb-1.0.18-win compressed folder, and extracted it.
I then tried to create a test project.
For such purpose I followed the enclosed Readme included in folder. I decided to use static library.
I created an empty win32 console project. I created header and static folders to contain .h and .lib. I made modifications for all configurations at include directories, library directories and additional dependencies using full path for first two, then filename for additional dependency. Then, I changed to Multi-Threaded Dll for runtime thingy.
I then tried some example test code from this link (libusb.h is included in cpp code) : http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/
Then I get following error :
1>------ Build started: Project: libusbtest3, Configuration: Debug Win32 ------
1>Linking...
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_exit@4 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_free_device_list@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_device_list@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_set_debug@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_init@4 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_free_config_descriptor@4 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_config_descriptor@12 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_device_descriptor@8 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>blaba\Visual Studio 2008\Projects\libusbtest3\Debug\libusbtest3.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://blabla\Visual Studio 2008\Projects\libusbtest3\libusbtest3\Debug\BuildLog.htm"
1>libusbtest3 - 9 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm assuming my library isn't recognised in project. Why is that ? I followed readme scupulously...
From what I have look up, I'm not first to have issue but I can't find sufficiently detailed explanation. Plus libusb doc is really lacking.
I post in this topic because it seems more like a general C/C++ issue, and I have little experience with linking external libraries.
Thanks in advance.
I have a basic issue with configuring the lastest libusb to work under Visual Studio 2008, with a Windows 7 64-bit. I installed the libusb-win32 driver for my device.
I downloaded the libusb-1.0.18-win compressed folder, and extracted it.
I then tried to create a test project.
For such purpose I followed the enclosed Readme included in folder. I decided to use static library.
I created an empty win32 console project. I created header and static folders to contain .h and .lib. I made modifications for all configurations at include directories, library directories and additional dependencies using full path for first two, then filename for additional dependency. Then, I changed to Multi-Threaded Dll for runtime thingy.
I then tried some example test code from this link (libusb.h is included in cpp code) : http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/
Then I get following error :
1>------ Build started: Project: libusbtest3, Configuration: Debug Win32 ------
1>Linking...
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_exit@4 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_free_device_list@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_device_list@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_set_debug@8 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_init@4 referenced in function _main
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_free_config_descriptor@4 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_config_descriptor@12 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>maintest.obj : error LNK2019: unresolved external symbol _libusb_get_device_descriptor@8 referenced in function "void __cdecl printdev(struct libusb_device *)" (?
printdev@@YAXPAUlibusb_device@@@Z)
1>blaba\Visual Studio 2008\Projects\libusbtest3\Debug\libusbtest3.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://blabla\Visual Studio 2008\Projects\libusbtest3\libusbtest3\Debug\BuildLog.htm"
1>libusbtest3 - 9 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm assuming my library isn't recognised in project. Why is that ? I followed readme scupulously...
From what I have look up, I'm not first to have issue but I can't find sufficiently detailed explanation. Plus libusb doc is really lacking.
I post in this topic because it seems more like a general C/C++ issue, and I have little experience with linking external libraries.
Thanks in advance.
Attachments
-
3.1 KB Views: 29