与 OpenSSL 的静态链接

发布于 2024-11-25 06:20:37 字数 970 浏览 3 评论 0原文

我们有一个项目与这个问题中报告的项目非常相似,其中 OpenSSL 是lib B。编译可执行文件 (Exe 1) 时,问题是我们遇到了一些似乎与 OpenSSL 链接相关的链接问题。

(cryptlib.obj) LNK2019: unresolved external symbol __alloca_probe_16 referenced in function _OPENSSL_isservice
(bss_file.obj) LNK2001: unresolved external symbol __alloca_probe_16 
(b_print.obj)  LNK2019: unresolved external symbol __ftol2_sse referenced in function _roundv

编译该库不会给出任何错误。我很想知道这些函数位于哪里,以便我可以在项目中添加正确的引用。

我正在使用 64 位进程的 Windows 7 上运行,如果这有什么区别的话:)

Edit1
这些是用VS2010在Win32中编译时出现的错误。

编辑2
OpenSSL lib (libeay32.lib) 也使用 VS2010(针对 Win32)的 nasm 进行编译。

编辑3
如果有人可以指出使用 VS2010 (vc2010) 或 VS2008 编译器构建 OpenSSL 的链接,这也会很有帮助(而不是指向 OpenSSL 中的 InstallW** 文件)

Edit4
我们还使用 Windows DDK 2003,如果它可以提供帮助的话。

We have a project really similar to the one reported in this question where OpenSSL is the starting point of lib B. When compiling the executable (Exe 1), the problem is that we are getting some linking issues that seems to be related to OpenSSL linking.

(cryptlib.obj) LNK2019: unresolved external symbol __alloca_probe_16 referenced in function _OPENSSL_isservice
(bss_file.obj) LNK2001: unresolved external symbol __alloca_probe_16 
(b_print.obj)  LNK2019: unresolved external symbol __ftol2_sse referenced in function _roundv

Compiling the library doesn't give any error whatsoever. I'm curious to know where are located these functions so that I can add the correct references in the project.

I'm running on Windows 7 with a 64 bits proc, if that can make any difference :)

Edit1
Those are errors when compiling in Win32 with VS2010.

Edit2
The OpenSSL lib (libeay32.lib) was also compiled with nasm for VS2010 (for Win32).

Edit3
If someone could point out a link to build OpenSSL with VS2010 (vc2010) or VS2008 compiler, that would also be helpfull (other than pointing to the InstallW** files in OpenSSL)

Edit4
We are also using the Windows DDK 2003, if it can help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回首观望 2024-12-02 06:20:37

以下是我解决该问题所采取的步骤:

解决 __alloca_probe_16 链接错误

由于我们安装了 Visual Studio 2008,因此我们使用了一些 obj 文件解决这个问题。 alloca16.obj 存在于 Visual Studio 2008 文件夹下的四个不同目录中(应该类似于 C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/crt/src /intel/XXX_lib 其中 XXX 可能是 dllmtxdllxmt。请注意,我不太确定它们之间有什么区别)。

将此路径添加到Linker>一般>项目的“属性”面板下的“附加库目录”,并将 alloca16.obj 添加到“链接器”>输入>附加依赖项解决了这个问题。

解决 __ftol2_sse 链接错误

这个问题有点棘手。使用 no-sse2 标志配置 OpenSSL 似乎 可以解决问题...但从版本 1.0.0d 开始就不行了。我创建了一个新的头文件,其中包含以下内容:(

extern "C" { 
   long _ftol( double ); 
   long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
}

this 所示 网站)

Here are the steps I took to solve the issue :

Solving the __alloca_probe_16 linking error

Since we also have Visual Studio 2008 installed we used some obj files to fix this issue. alloca16.obj is present in four different directories under the Visual Studio 2008 folder (which should be something like C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/crt/src/intel/XXX_lib where XXX might be dll, mt, xdll or xmt. Note that I'm not quite sure what is the difference between any of them).

Adding this path to the Linker > General > Addtionnal Library Directories under the Properties panel of the project and adding alloca16.obj to the Linker > Input > Addtional Dependencies solved the issue.

Solving the __ftol2_sse linking error

This one is a little bit tricky. Configuring OpenSSL with no-sse2 flag seems like it would fix the problem... but not as of version 1.0.0d. I created a new header file which contains this :

extern "C" { 
   long _ftol( double ); 
   long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
}

(as shown on this site)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文