我正在使用Crypto ++库的Windows Phone 8端口。我正在尝试创建一个DLL。我长期遭遇LNK1107: invalid or corrupt file
错误。
我已将DLL版本减少为一个名为dll-wp8.obj
且DllMain
的对象文件。当我尝试链接它时,我得到:
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\bin\x
86_arm\cl.exe" /nologo /D NDEBUG /W3 /Os /Oy- /D WINAPI_FAMILY=WINAPI_FAMILY_PHO
NE_APP /AI "C:\Program Files (x86)\Windows Phone Kits\8.0\Windows Metadata" /FI
SDKDDKVer.h /FI winapifamily.h /WX- /GL /D _USRDLL /D _WINDLL /Gm- /EHsc /MD /
GS /fp:precise /D CRYPTOPP_EXPORTS /D CRYPTOPP_DISABLE_ASM /D CRYPTOPP_DISABLE_
SSE2 /D CRYPTOPP_DISABLE_SSE3 -c dll-wp8.cpp
dll-wp8.cpp
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\bin\x
86_arm\link.exe" /nologo /release /manifest:no /subsystem:console /LTCG /TLBID:1
/WINMD:NO /DYNAMICBASE /NXCOMPAT /MACHINE:ARM /DLL /verbose WindowsPhoneCore.l
ib RuntimeObject.lib PhoneAppModelHost.lib /implib:cryptlib.lib /out:cryptlib.dl
l dll-wp8.obj
Starting pass 1
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\bin\x86_arm\li
nk.exe : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B8
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\WPSDK\WP80\bin\x86_arm\link.exe"' : return code '0x453'
Stop.
命令行与Visual Studio 2012 / Windows Phone项目创建的内容一致。在Visual Studio下,类似的空项目链接正常。 编辑:Visual Studio使用响应文件而不是直接驱动编译器。这可能是相关的:Capture Visual Studio response file?。
似乎找到了所有文件,它们都是ARM。这些文件为WindowsPhoneCore.lib
RuntimeObject.lib
PhoneAppModelHost.lib
和dll-wp8.obj
:
C:\Users\Jeffrey\cryptopp>dumpbin /headers dll-wp8.obj | findstr machine
1C4 machine (ARM)
从编译开关中删除/GL
并转储符号显示导出DllMain
:
C:\Users\Jeffrey\cryptopp>dumpbin /symbols dll-wp8.obj | findstr DllMain
2A4 00000000 SECTE1 notype () External | DllMain
2A5 00000000 SECTE1 notype Label | $LN5@DllMain
2A8 00000000 SECTE2 notype Static | $pdata1$DllMain
2AD 00000000 SECTE3 notype Static | $unwind2$DllMain
如何确定哪个文件无效或已损坏?