【问题标题】:Building OpenSSL under Borland C++ Builder, Win 8.1在 Borland C++ Builder 下构建 OpenSSL,Win 8.1
【发布时间】:2015-07-16 15:00:25
【问题描述】:

我按照 INSTALL.W32(各种 OpenSSL 版本)的说明进行操作,通常是:

 * Configure for building with Borland Builder:
   > perl Configure BC-32

 * Create the appropriate makefile
   > ms\do_nasm

 * Build
   > make -f ms\bcb.mak

现在,我在尝试构建时确实遇到了两种错误:

对于 OpenSSL

nasmw -f obj -d__omf__ -ocrypto\md5\asm\m5_win32.obj .\crypto\md5\asm\m5_win32.asm
'nasmw' is not recognized as an internal or external command,
operable program or batch file.

否则

Warning W8017 C:\CBuilder5\Include\sys/stat.h 34: Redefinition of 'S_IFMT' is not identical
Warning W8017 C:\CBuilder5\Include\sys/stat.h 35: Redefinition of 'S_IFDIR' is not identical
Error E2227 .\crypto\rand\randfile.c 226: Extra parameter in call to _open in function RAND_write_file
Warning W8053 .\crypto\rand\randfile.c 262: '_chmod(const signed char *,int,...)' is obsolete in function RAND_write_file
*** 1 errors in Compile ***

是的,我觉得使用 Borland C++ Builder 5 很糟糕,但我对此无能为力,是的,如果其他一切都失败了,我会考虑使用 Shining Light 选项。

【问题讨论】:

  • 您是否在网上搜索过有关使用 Borland C++ Builder 5 构建 OpenSSL 的教程?似乎有明确的说明。
  • 当然,这是我做的第一件事。

标签: c++ openssl c++builder borland-c++


【解决方案1】:

我不使用 OpenSSL,但从您的文字中得到了一些提示:

  1. NASM

    • 不是 Borland 编译器的默认汇编器
    • 需要先下载安装
    • (它是免费的,是我过去使用过的最好的编译器之一)
  2. 在包含 OpenSSL 或包含错误顺序之前,您缺少一些 #define

    • 这就是为什么您会收到第一个警告,而且很可能还有错误
    • 一些库需要添加配置#defines(由某些特定的IDE添加)
    • 指定使用什么编译器、平台、字节序...
    • 在任何包含之前
    • 通常如果您以错误的顺序包含,则定义是为 lib 文件的某些实例定义的,但不是为所有实例定义的
    • 所以尝试重新排序包含
    • 有时有助于在 lib 之前包含一些其他内容,例如 conio、stdio、windows...
    • 要确定哪个定义丢失或错误打开stat.h
    • 并在S_IFMT 周围寻找#ifdef #ifndef 语句

【讨论】:

    【解决方案2】:

    最新版本 (1.0.2d) 的解决方案是:

    1. 从 randfile 中删除额外的参数(正如评论所述,这是不必要的),
    2. 编辑ms\bcb.mak,搜索-DMD5_ASM -DSHA1_ASM -DRMD160_ASM 并更改为 -DMD5_NO_ASM -DSHA1_NO_ASM -DRMD160_NO_ASM 。 (SHA、MD5 和 RMD160 存在未解决的外部错误,它们基本上无法在 asm 中编译)。

    还包括其他一些步骤,但它们仅针对我的环境。

    【讨论】:

      猜你喜欢
      • 2011-05-28
      • 2014-08-11
      • 2014-12-10
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 2013-01-07
      • 2022-01-07
      • 2010-09-25
      相关资源
      最近更新 更多