你如何为 x64 编译 OpenSSL? [英] How do you compile OpenSSL for x64?

查看:36
本文介绍了你如何为 x64 编译 OpenSSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照 INSTALL.W64 中的说明操作后,我有两个问题:

  • 代码仍然写入out32"文件夹.我需要能够在我的工作站上链接到 32 位和 64 位版本的库,所以我不希望 64 位版本破坏 32 位库.
  • 输出仍然是 32 位的!这意味着我在尝试从 x64 应用程序链接到库时收到未解析的外部符号"错误.

解决方案

要编译静态库(发布和调试),您需要这样做:

  1. 安装 Perl - www.activestate.com
  2. 运行Visual Studio 2008 x64 交叉工具命令提示符"(注意:常规命令提示符不起作用.)
  3. 配置perl 配置VC-WIN64A no-shared no-idea
  4. 运行:msdo_win64a
  5. 编辑 ms t.mak 并将输出目录中的32"更改为64":

<前># 所有有趣的东西的输出目录OUT_D=out64.dbg# 所有临时垃圾的输出目录TMP_D=tmp64.dbg# 头文件的输出目录INC_D=inc64INCO_D=inc64openssl

  1. 如果出现错误,请编辑 ms t.mak 并从 EX_LIBS 中删除 bufferoverflowu.lib.
  2. 运行:nmake -f ms t.mak
  3. 编辑 msdo_win64a 文件并将调试"添加到除ml64"和最后两行之外的所有行
  4. 运行:msdo_win64a
  5. 重复第 4 步和第 5 步
  6. 编辑 ms t.mak 文件并将/Zi 添加到 CFLAG 列表中!
  7. 运行:nmake -f ms t.mak

After following the instructions in INSTALL.W64 I have two problems:

  • The code is still written to the "out32" folder. I need to be able to link to both 32-bit and 64-bit versions of the library on my workstation, so I don't want the 64-bit versions to clobber the 32-bit libs.
  • The output is still 32-bit! This means that I get "unresolved external symbol" errors when trying to link to the libraries from an x64 app.

解决方案

To compile the static libraries (both release and debug), this is what you need to do:

  1. Install Perl - www.activestate.com
  2. Run the "Visual Studio 2008 x64 Cross Tools Command Prompt" (Note: The regular command prompt WILL NOT WORK.)
  3. Configure with perl Configure VC-WIN64A no-shared no-idea
  4. Run: msdo_win64a
  5. EDIT ms t.mak and change "32" to "64" in the output dirs:

    # The output directory for everything intersting
    OUT_D=out64.dbg
    # The output directory for all the temporary muck
    TMP_D=tmp64.dbg
    # The output directory for the header files
    INC_D=inc64
    INCO_D=inc64openssl

  1. EDIT ms t.mak and remove bufferoverflowu.lib from EX_LIBS if you get an error about it.
  2. Run: nmake -f ms t.mak
  3. EDIT the msdo_win64a file and ADD "debug" to all lines, except the "ml64" and the last two lines
  4. Run: msdo_win64a
  5. Repeat steps 4 and 5
  6. EDIT the ms t.mak file and ADD /Zi to the CFLAG list!
  7. Run: nmake -f ms t.mak

这篇关于你如何为 x64 编译 OpenSSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆