64位移植:判断库dll是否为64位

64位的程序是不能加载32位的库,32位的库和64位应用程序是不兼容的。 所以如果在load过程中发现出错,首先得确定所加载的库是64的。如何判断库是64位的?dumpbin.exe 它用来分析二进制库和程序的结构。在应用程序中找到 VS2010 -> VS tools -> VS x64 Win64 Command Prompt 执行dumpbin命令。下面分别为32位和64位库的不同。

32bit DLL

C:\Program Files (x86)\Java50\jre\bin\j9vm>dumpbin /headers jvm.dll

Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file jvm.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
             14C machine (x86)
               5 number of sections
        4720D7EE time date stamp Fri Oct 26 01:52:46 2007
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
            210E characteristics
                   Executable
                   Line numbers stripped
                   Symbols stripped
                   32 bit word machine
                   DLL

64bit DLL

C:\Program Files\Java50\jre\bin\j9vm>dumpbin /headers jvm.dll

Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file jvm.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
            8664 machine (x64)
               6 number of sections
        43696321 time date stamp Thu Nov 03 09:08:49 2005
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            202E characteristics
                   Executable
                   Line numbers stripped
                   Symbols stripped
                   Application can handle large (>2GB) addresses
                   DLL


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值