Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

windows 版编译失败 #24

Open
helperfunc opened this issue Feb 19, 2021 · 1 comment
Open

windows 版编译失败 #24

helperfunc opened this issue Feb 19, 2021 · 1 comment

Comments

@helperfunc
Copy link

根据 https://github.com/HeQuanX/navicat-keygen-tools/blob/windows/doc/how-to-build.zh-CN.md 文档安装好了所需的库。
在 visual studio 2019 里生成时,报错。

2>ImageInterpreter.cpp
1>D:\navicat-keygen-tools\common\RSACipher.hpp(106,1): error C2027: 使用了未定义类型“rsa_st”
1>D:\vcpkg\installed\x64-windows-static\include\openssl\evp.h(1018): message : 参见“rsa_st”的声明
1>D:\navicat-keygen-tools\common\RSACipher.hpp(109,1): error C2027: 使用了未定义类型“rsa_st”
1>D:\vcpkg\installed\x64-windows-static\include\openssl\evp.h(1018): message : 参见“rsa_st”的声明
2>KeystoneAssembler.cpp
1>SerialNumberGenerator.cpp
2>Misc.cpp
1>_tmain.cpp
2>PatchSolution0.cpp
1>D:\navicat-keygen-tools\common\RSACipher.hpp(106,1): error C2027: 使用了未定义类型“rsa_st”
1>D:\vcpkg\installed\x64-windows-static\include\openssl\evp.h(1018): message : 参见“rsa_st”的声明
1>D:\navicat-keygen-tools\common\RSACipher.hpp(109,1): error C2027: 使用了未定义类型“rsa_st”
1>D:\vcpkg\installed\x64-windows-static\include\openssl\evp.h(1018): message : 参见“rsa_st”的声明
1>正在生成代码...
1>已完成生成项目“navicat-keygen.vcxproj”的操作 - 失败。

指向的 RSACipher.hpp 中的错误代码:

        size_t Bits() const {
            if (Get()->n == nullptr) {
                throw Exception(NKG_CURRENT_SOURCE_FILE(), NKG_CURRENT_SOURCE_LINE(), TEXT("RSA modulus has not been set."));
            } else {
                return BN_num_bits(Get()->n);
            }
        }

中的 Get()->n

@gylearner
Copy link

gylearner commented Mar 19, 2021

我也遇到了相同的问题,该如何解决?@DoubleLabyrinth @HeQuanX @logiccodes
我似乎解决了这个问题
一是参考Linux版本的文件,将错误函数修改为
[[nodiscard]]
size_t Bits() const {
return RSA_bits(Get());
}
修改完成后,还应在文件头部加入
#pragma comment(lib, "crypt32")
#pragma comment(lib, "ws2_32.lib")
成功生成可执行文件,但还未测试。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants