Replies: 25 comments
-
If you use the option If you want to build with libusb-1.0, my recommendation will be using MSYS2 mingw32/mingw64. But you can still try under Visual Studio. You need to disable "Using external library". Long ago I tried to use vcpkg but I was not successful. Still since I do not usually use VS but rather prefer MinGW, I did not persue further. |
Beta Was this translation helpful? Give feedback.
-
Test using vcpkg, it does not seem to work well.
|
Beta Was this translation helpful? Give feedback.
-
If you follow the official instruction, it should work our of the box.
VS2022 build log (x64 release).
|
Beta Was this translation helpful? Give feedback.
-
Result:
|
Beta Was this translation helpful? Give feedback.
-
@mcuee, I'm not having trouble compiling. My problem is enabling usblib-1.0 support. But right now I'm using MinGW as you suggested yesterday and apparently it's working for me. |
Beta Was this translation helpful? Give feedback.
-
Yes, as of now, using MinGW is the way if you want to use libusb-1.0 under Windows. vcpkg is not supported as of now.
I think you can still make it work by manually pointing CMake the location of the libusb-1.0 library, but sometimes the header file can be a problem. I will try it myself later. |
Beta Was this translation helpful? Give feedback.
-
vcpkg running example: you will encounter problems finding
Error message:
|
Beta Was this translation helpful? Give feedback.
-
A simple workaround is to copy
However, there are still errors when building the solution.
So I gave up in the end. |
Beta Was this translation helpful? Give feedback.
-
All in all, vcpkg build with libusb-1.0 is not supported as of now. If someone figures out the solution, please update here. |
Beta Was this translation helpful? Give feedback.
-
BTW, if you do not use libusb-1.0 and just Readline, then it works. It needs readline.dll as dynamic linking is used.
|
Beta Was this translation helpful? Give feedback.
-
The issue was the same as last time when I was trying to use vcpkg to build avrdude 7.0 release..
|
Beta Was this translation helpful? Give feedback.
-
A few reasons why this is a low priority.
|
Beta Was this translation helpful? Give feedback.
-
The reason is explained here: Why is this not caught by github action? That is because the default MSVC build does not use libusb-1.0, rather use avrdude-libusb. The following simple fix is good to sort out the issue.
@mariusgreuel |
Beta Was this translation helpful? Give feedback.
-
But the header file detection for vcpkg files are still a problem (libub-1.0 and readline). What I did (to copy files to |
Beta Was this translation helpful? Give feedback.
-
Please try the above simple patch to |
Beta Was this translation helpful? Give feedback.
-
If I use the similar command as @am-ar, I am able to reproduce the same issue for git main. Looks like current CMake scripts can not find libusb-1.0 and readline.
|
Beta Was this translation helpful? Give feedback.
-
Workaround is to explicitly point CMake to GNU Readline and libusb-1.0 vcpkg lib files.
But then building will fail.
Dirty work-around is to copy both
|
Beta Was this translation helpful? Give feedback.
-
Full steps.
|
Beta Was this translation helpful? Give feedback.
-
The result binary works fine. Take note you need to copy the file
|
Beta Was this translation helpful? Give feedback.
-
Please look at this one as well when you got the time. Or do you think we can close this as not planned? |
Beta Was this translation helpful? Give feedback.
-
Yes. I'd say this request is outside the scope. Our MSVC build is only supported using the USE_EXTERNAL_LIBS switch and libraries. @am-ar When setting up AVRDUDE for Windows I looked at vcpkg and other packages, too. But they were pretty much all unusable. You are welcome to submit a PR, though if you think this would add some extra value over our Windows build. |
Beta Was this translation helpful? Give feedback.
-
@mariusgreuel when I opened the issue I was trying to compile using Visual Studio, however after understanding that there was a complication due to the libraries I chose to use it via MinGW. For me the result was satisfactory and I don't feel the need to work more on it. So much so that the result was PR #1215. |
Beta Was this translation helpful? Give feedback.
-
@am-ar Thanks for the feedback. I am closing the issue then. |
Beta Was this translation helpful? Give feedback.
-
Just a note to build using command line.
|
Beta Was this translation helpful? Give feedback.
-
VS2019 build using Ninja.
|
Beta Was this translation helpful? Give feedback.
-
I'm using vcpkg to install the libraries on windows, but cmake doesn't find libusb-1.0:
[cmake] -- DON'T HAVE libusb_1_0
What is the correct way to install?
vcpkg.exe list
cmake --no-warn-unused-cli -DUSE_LIBUSBWIN32=TRUE -DUSE_EXTERNAL=TRUE -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -S. -Bbuild -G "Visual Studio 17 2022" -T host=x64 -A x64
Beta Was this translation helpful? Give feedback.
All reactions