pololu / libusbp

The Pololu USB Library (also known as libusbp) is a cross-platform C library for accessing USB devices.
Other
106 stars 34 forks source link

Does not build with MSYS2 mingw64 on Windows 11 #14

Closed mbparker closed 1 year ago

mbparker commented 1 year ago

I followed the instructions to the letter with a brand new install of MSYS2.

However, at the point of running the CMAKE command, all I get is this:

MINGW64 ~/libusbp/build
$ MSYS2_ARG_CONV_EXCL=- cmake .. -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_AR was not found, please set to archive program.
-- Configuring incomplete, errors occurred!

I'm guessing that either some assumptions are made about things that have already been installed, or I'm mis-interpreting something.

I ran this as advised in a similar issue:

$ echo $MSYSTEM which cmake which gcc MINGW64 /mingw64/bin/cmake /mingw64/bin/gcc

Please advise.

(I had no problems with the macOS or Linux builds, btw)

DavidEGrayson commented 1 year ago

What do you get if you run which make ?

mbparker commented 1 year ago

What do you get if you run which make ?

$ which make which: no make in (/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

That seems problematic. Is there a specific version of Make that I should install? or Is pacman -S make sufficient?

DavidEGrayson commented 1 year ago

Yeah, you should do pacman -S make. I'll think about adding that to the directions, or just changing the directions to use the default generator, which is now Ninja.

mbparker commented 1 year ago
$ make
[  5%] Building C object src/CMakeFiles/usbp.dir/async_in_pipe.c.obj
[ 10%] Building C object src/CMakeFiles/usbp.dir/error.c.obj
[ 15%] Building C object src/CMakeFiles/usbp.dir/error_hresult.c.obj
[ 20%] Building C object src/CMakeFiles/usbp.dir/find_device.c.obj
[ 25%] Building C object src/CMakeFiles/usbp.dir/list.c.obj
[ 30%] Building C object src/CMakeFiles/usbp.dir/pipe_id.c.obj
[ 35%] Building C object src/CMakeFiles/usbp.dir/string.c.obj
[ 40%] Building C object src/CMakeFiles/usbp.dir/windows/error_windows.c.obj
[ 45%] Building C object src/CMakeFiles/usbp.dir/windows/device_windows.c.obj
[ 50%] Building C object src/CMakeFiles/usbp.dir/windows/interface_windows.c.obj
[ 55%] Building C object src/CMakeFiles/usbp.dir/windows/device_instance_id_windows.c.obj
[ 60%] Building C object src/CMakeFiles/usbp.dir/windows/generic_interface_windows.c.obj
[ 65%] Building C object src/CMakeFiles/usbp.dir/windows/list_windows.c.obj
[ 70%] Building C object src/CMakeFiles/usbp.dir/windows/generic_handle_windows.c.obj
[ 75%] Building C object src/CMakeFiles/usbp.dir/windows/async_in_transfer_windows.c.obj
[ 80%] Building C object src/CMakeFiles/usbp.dir/windows/serial_port_windows.c.obj
[ 85%] Building RC object src/CMakeFiles/usbp.dir/info.rc.obj
[ 90%] Linking C shared library ../libusbp-1.dll
[ 90%] Built target usbp
[ 95%] Building C object install_helper/CMakeFiles/install_helper.dir/install_helper_windows.c.obj
[100%] Linking C shared library ../libusbp-install-helper-1.dll
[100%] Built target install_helper

We have joy - thank you for the prompt assistance.