avrdudes / libusb Goto Github PK
View Code? Open in Web Editor NEWlibusb for Windows
License: GNU General Public License v3.0
libusb for Windows
License: GNU General Public License v3.0
I think it is better to update the Readme file so that people will not confuse this with either libusb project or libusb-win32 project.
Ref: https://github.com/mariusgreuel/avrdude#support-winusb-devices-via-custom-libusb
This build contains a custom library called libwinusb, which implements a sub-set of the libusb-win32 API. The libwinusb implementation supports both the winusb.sys driver, and the libusb0.sys driver as well.
Using https://www.msys2.org/ on Windows. Reproduction:
pacman -S mingw-w64-x86_64-toolchain cmake git
git clone https://github.com/avrdudes/libusb.git
cd libusb
mkdir build
cd build
cmake -DCMAKE_VERBOSE_MAKEFILE=True ..
make
gives
$ cmake ..
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
System is unknown to cmake, create:
Platform/MINGW64_NT-10.0-19045 to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
-- Detecting C compiler ABI info
System is unknown to cmake, create:
Platform/MINGW64_NT-10.0-19045 to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
System is unknown to cmake, create:
Platform/MINGW64_NT-10.0-19045 to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /mingw64/bin/CC.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/Max/libusb/build
Max@DESKTOP-KF7FNFU MINGW64 ~/libusb/build
$ make
/usr/bin/cmake.exe -S/home/Max/libusb -B/home/Max/libusb/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake.exe -E cmake_progress_start /home/Max/libusb/build/CMakeFiles /home/Max/libusb/build//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/Max/libusb/build'
make -f CMakeFiles/libusb.dir/build.make CMakeFiles/libusb.dir/depend
make[2]: Entering directory '/home/Max/libusb/build'
cd /home/Max/libusb/build && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /home/Max/libusb /home/Max/libusb /home/Max/libusb/build /home/Max/libusb/build /home/Max/libusb/build/CMakeFiles/libusb.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/Max/libusb/build'
make -f CMakeFiles/libusb.dir/build.make CMakeFiles/libusb.dir/build
make[2]: Entering directory '/home/Max/libusb/build'
[ 16%] Building C object CMakeFiles/libusb.dir/src/descriptors.c.obj
/mingw64/bin/cc.exe -DLOG_APPNAME=\"avrdude\" -D_CRT_SECURE_NO_WARNINGS=1 -I/home/Max/libusb/include -MD -MT CMakeFiles/libusb.dir/src/descriptors.c.obj -MF CMakeFiles/libusb.dir/src/descriptors.c.obj.d -o CMakeFiles/libusb.dir/src/descriptors.c.obj -c /home/Max/libusb/src/descriptors.c
[ 33%] Building C object CMakeFiles/libusb.dir/src/error.c.obj
/mingw64/bin/cc.exe -DLOG_APPNAME=\"avrdude\" -D_CRT_SECURE_NO_WARNINGS=1 -I/home/Max/libusb/include -MD -MT CMakeFiles/libusb.dir/src/error.c.obj -MF CMakeFiles/libusb.dir/src/error.c.obj.d -o CMakeFiles/libusb.dir/src/error.c.obj -c /home/Max/libusb/src/error.c
[ 50%] Building C object CMakeFiles/libusb.dir/src/registry.c.obj
/mingw64/bin/cc.exe -DLOG_APPNAME=\"avrdude\" -D_CRT_SECURE_NO_WARNINGS=1 -I/home/Max/libusb/include -MD -MT CMakeFiles/libusb.dir/src/registry.c.obj -MF CMakeFiles/libusb.dir/src/registry.c.obj.d -o CMakeFiles/libusb.dir/src/registry.c.obj -c /home/Max/libusb/src/registry.c
[ 66%] Building C object CMakeFiles/libusb.dir/src/usb.c.obj
/mingw64/bin/cc.exe -DLOG_APPNAME=\"avrdude\" -D_CRT_SECURE_NO_WARNINGS=1 -I/home/Max/libusb/include -MD -MT CMakeFiles/libusb.dir/src/usb.c.obj -MF CMakeFiles/libusb.dir/src/usb.c.obj.d -o CMakeFiles/libusb.dir/src/usb.c.obj -c /home/Max/libusb/src/usb.c
[ 83%] Building CXX object CMakeFiles/libusb.dir/src/windows.cpp.obj
/mingw64/bin/CC.exe -DLOG_APPNAME=\"avrdude\" -D_CRT_SECURE_NO_WARNINGS=1 -I/home/Max/libusb/include -MD -MT CMakeFiles/libusb.dir/src/windows.cpp.obj -MF CMakeFiles/libusb.dir/src/windows.cpp.obj.d -o CMakeFiles/libusb.dir/src/windows.cpp.obj -c /home/Max/libusb/src/windows.cpp
In file included from C:/msys64/home/Max/libusb/src/windows.cpp:23:
C:/msys64/home/Max/libusb/src/windows.cpp: In function 'int usb_os_find_busses(usb_bus**)':
C:/msys64/home/Max/libusb/src/error.h:131:67: error: expected primary-expression before ')' token
131 | #define USBERR(format,...) usb_err(__FUNCTION__,format,__VA_ARGS__)
| ^
C:/msys64/home/Max/libusb/src/windows.cpp:93:9: note: in expansion of macro 'USBERR'
93 | USBERR("memory allocation failed\n");
| ^~~~~~
In file included from C:/msys64/home/Max/libusb/src/libwinusb.h:23,
from C:/msys64/home/Max/libusb/src/windows.cpp:19:
C:/msys64/home/Max/libusb/src/windows.cpp:98:10: error: 'strcpy_instead_use_StringCbCopyA_or_StringCchCopyA' is not a member of 'std'
98 | std::strcpy(bus->dirname, "bus-0");
| ^~~~~~
C:/msys64/home/Max/libusb/src/windows.cpp: In function 'int usb_os_find_devices(usb_bus*, usb_device**)':
C:/msys64/home/Max/libusb/src/windows.cpp:147:9: error: '_snprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
147 | _snprintf(dev->filename, LIBUSB_PATH_MAX - 1, "%s--%s",
| ^~~~~~~~~
make[2]: *** [CMakeFiles/libusb.dir/build.make:135: CMakeFiles/libusb.dir/src/windows.cpp.obj] Error 1
make[2]: Leaving directory '/home/Max/libusb/build'
make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/libusb.dir/all] Error 2
make[1]: Leaving directory '/home/Max/libusb/build'
make: *** [Makefile:94: all] Error 2
Reference:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.