-
Notifications
You must be signed in to change notification settings - Fork 160
Building AVRDUDE for Windows using MSYS2
If you prefer to use MSYS2 as your development environment, you may build AVRDUDE directly in MSYS2.
MSYS2 can also be used to build native Windows binaries, i.e. executables that do not require any MSYS2 DLLs to execute. If you want to create native Windows binaries, make sure that you do not use the MSYS environment. Instead, use a Windows compatible environment, such as MINGW32 or MINGW64.
The MSYS2 stock libraries, such as libusb-1.0, libusb-win32, or libftdi do not support the entire USB driver functionality, as the custom libraries of the MSVC builds do. The official avrdude Windows release will use MSVC builds. If you have trouble connecting to your USB devices, see Troubleshooting USB devices in Windows.
Update the package database first:
pacman -Syu
For 32-bit builds, use the MINGW32 environment and install
pacman -S --needed base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake
pacman -S --needed mingw-w64-i686-libelf mingw-w64-i686-libusb mingw-w64-i686-libusb-compat-git mingw-w64-i686-libusb-win32 mingw-w64-i686-hidapi mingw-w64-i686-libftdi
For 64-bit builds, use the MINGW64 environment and install
pacman -S --needed base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
pacman -S --needed mingw-w64-x86_64-libelf mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-libusb-win32 mingw-w64-x86_64-hidapi mingw-w64-x86_64-libftdi
Please take note minimum required version for CMake is 3.14.
For 32-bit builds, use the MINGW32 environment and run the following commands:
git clone https://github.com/avrdudes/avrdude.git
cd avrdude
cmake -G"MSYS Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_mingw32
cmake --build build_mingw32
For 64-bit builds, use the MINGW64 environment and run the following commands:
git clone https://github.com/avrdudes/avrdude.git
cd avrdude
cmake -G"MSYS Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_mingw64
cmake --build build_mingw64