openssl-1.0.0 的VC编译记录

参照以前0.9.8a的VC工程曾很顺利的做出0.9.8i的,现在继续做1.0.0的工程可费了劲了。

 

ssleay继昨天所述问题之后就停了转而先做libeay32.dsp了

新增了很多文件,通过比较Makefile得出文件的变动并更新了dsp,发现多了好多xxx_ameth.c/h xxx_pmeth.c/h的文件,还没细看干嘛用的。

 

inc32/openssl/opensslconf.h

增加了  #define OPENSSL_CPUID_OBJ
结果导致链接时unsigned long OPENSSL_ia32_cpuid(void);找不到实现了,其实也找到最后这段实际是在汇编中实现的了,

如果用不着可以简单讲上述宏定义注掉即可。

  #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
#define OPENSSL_CPUID_SETUP
void OPENSSL_cpuid_setup(void)
{ static int trigger=0;
  unsigned long OPENSSL_ia32_cpuid(void);
  char *env;

    if (trigger) return;

    trigger=1;
    if ((env=getenv("OPENSSL_ia32cap")))
 OPENSSL_ia32cap_P = strtoul(env,NULL,0)|(1<<10);
    else
 OPENSSL_ia32cap_P = OPENSSL_ia32_cpuid()|(1<<10);
    /*
     * |(1<<10) sets a reserved bit to signal that variable
     * was initialized already... This is to avoid interference
     * with cpuid snippets in ELF .init segment.
     */
}
#endif

 

如果要保留上述的OPENSSL_CPUID_OBJ呢?

在tmp32dll下面会发现x86cpuid.asm 及 x86cpuid.obj 后者若没有可以通过ml /c /coff x86cpuid.asm生成

遇到的问题时,即使把该文件拷到放中间obj文件的debug下面也链接不到,工程中加上asm并custom build也不行(Output Dir 压根就不生效)

在link里面加上该obj,则函数都链接过了

报如下错误:

  --------------------Configuration: libeay32 - Win32 Debug--------------------
Performing Custom Build Step on ../../tmp32dll/x86cpuid.asm
 Assembling: /OpenSSLDev/openssl-1.0.0/tmp32dll/x86cpuid.asm
Microsoft (R) Macro Assembler Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
Linking...
   Creating library ../../out32dll/Debug/libeay32.lib and object ../../out32dll/Debug/libeay32.exp
LINK : fatal error LNK1000: unknown error; consult documentation for technical support options
Error executing link.exe.

libeay32.dll - 1 error(s), 0 warning(s)

 

不知怎么了,不知是不是环境的缘故。windows7笔记本编的

--换了2003系统,依然是如此

 

 

 

 

对ssleay32.dll的编译很麻烦,但最后解决方法很简单,增加了WIN32_LEAN_AND_MEAN就解决了。

另写一篇介绍他的作用。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值