您的位置:首页 > 运维架构

openssl-1.0.0 的VC编译记录

2010-04-01 13:24 423 查看
参照以前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就解决了。

另写一篇介绍他的作用。

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息