Host Environment
To Reproduce
vcpkg install mosquitto:x86-windows-static
vcpkg install mosquitto:x64-windows-static
(Dynamic are working)
Failure logs
Package: mosquitto:x64-windows-static
Vcpkg version: 2020.02.04-nohash-external
The following packages will be built and installed:
mosquitto[core]:x64-windows-static
Starting package 1/1: mosquitto:x64-windows-static
Building package mosquitto[core]:x64-windows-static...
-- Note: mosquitto only supports dynamic library linkage. Building dynamic library.
CMake Error at scripts/cmake/vcpkg_check_linkage.cmake:42 (message):
Refusing to build unexpected dynamic library against the static CRT. If
this is desired, please configure your triplet to directly request this
configuration.
Call Stack (most recent call first):
ports/mosquitto/portfile.cmake:1 (vcpkg_check_linkage)
scripts/ports.cmake:90 (include)
Hi @gizmocuz
Thanks for posting this issue.
Since static build on Windows is currently not supported in vcpkg.
The result you encountered is intended now.
I will try to fix this later.
@gizmocuz
I submitted a PR to fix this.
Could you please help confirm if this can work for you?
The PR has been merged. Please try to update vcpkg and rebuild this.
@NancyLi1013 , Thank you for the PR
Unfortunately it does not work 100%, when using the static triplet no DLL's are copied into the build folder.
But the final executable still depends on mosquitto.dll

It seems something does not go 100% correct here...
@gizmocuz
Thanks for your feedback. I will look into this on my local.
Compiled/Tested under Windows, this works great ! Thanks
Okay. Since you can work normally, I am going to close this issue now.
Please open a new issue if you have other problems.
@NancyLi1013 , I am very sorry about this, This post/remark was for another project (MQTT Explorer), this issue is not solved... Sorry!
Could you please provide your project case?
@gizmocuz
Please let me know if you still have any concern about this issue.