netty-tcnative-openssl-static-2.0.28.Final-windows-x86_64.jar正在动态链接到openssl

netty-tcnative-openssl-static-2.0.28.Final-windows-x86_64.jar正在动态链接到openssl,openssl,netty,static-linking,Openssl,Netty,Static Linking,从源代码构建netty-tcnative-openssl-static-2.0.28.Final-windows-x86_64后,使用创建的jar文件会在运行时导致未解决的依赖项错误: Suppressed: java.lang.UnsatisfiedLinkError: AppData\Local\Temp\1\netty_tcnative2630860948705617016.dll: Can't find dependent libraries 这可能是由于netty_tcnative.

从源代码构建netty-tcnative-openssl-static-2.0.28.Final-windows-x86_64后,使用创建的jar文件会在运行时导致未解决的依赖项错误:

Suppressed: java.lang.UnsatisfiedLinkError: AppData\Local\Temp\1\netty_tcnative2630860948705617016.dll: Can't find dependent libraries
这可能是由于netty_tcnative.dll依赖于openssl dll造成的:

dumpbin /dependents openssl-static\target\native-build\target\x64-release\lib\netty_tcnative.dll
Image has the following dependencies:

    libssl-1_1-x64.dll
    libcrypto-1_1-x64.dll
    KERNEL32.dll
    WS2_32.dll
知道为什么这些不会静态链接到netty_tcnative.dll吗

构建是使用Windows 10、x86 x64交叉工具Microsoft Visual Studio Professional 2015完成的
版本14.0.25420.01更新3

openssl构建将导入库复制到目标目录

netty-tcnative\openssl-static\target\ssl\lib, 
不是静态库。这些是由tcnetty_native build挑选的

但是,静态库也是使用openssl构建创建的

netty-tcnative\openssl-static\target\openssl-1.1.1d\*_static.lib 
作为一种解决方法,将_static.lib版本复制到目标目录中,替换非_static版本确实有帮助。注意,这还需要将msvcrt.lib作为附加依赖项包含在内。在netty tcnative\vs2010.vcxproj.static.template中:

<AdditionalDependencies>mswsock.lib;ws2_32.lib;rpcrt4.lib;shlwapi.lib;psapi.lib;apr-1.lib;msvcrt.lib;@SSL_LIBS@;%(AdditionalDependencies)</AdditionalDependencies>
mswsock.lib;ws2_32.lib;rpcrt4.lib;shlwapi.lib;psapi.lib;apr-1.lib;msvcrt.lib@SSL_LIBS@;%(附加依赖项)