VC11 LNK1107引用头文件

时间:2013-07-25 15:47:37

标签: c++ c visual-c++ visual-studio-2012 linker

所以我现在已经寻找了近2天来解决我的问题,但是其他所有人都遇到这个错误似乎是连接到dll而不是lib。但是,对我来说情况似乎并非如此,所以我在这里。

我正在尝试使用vc110(VS2012)工具链在Visual Studio 2012中构建项目。但是,每当我构建项目时,我都会从构建日志中获得以下链接器错误(详细的详细程度):

1>Task "Link"
1>  Environment Variables passed to tool:
1>    VS_UNICODE_OUTPUT=1344
1>  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.exe" /INCREMENTAL /NOLOGO /LIBPATH:S:\twk_amf\Implementation\EditorServiceMgr\proj\Win\vc9\..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\..\..\..\..\..\..\external\Trolltech_Qt4\lib\win\x64\Debug msvcrtd.lib QtCored4.lib QtGuid4.lib QtXmld4.lib QtNetworkd4.lib QtUiToolsd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcp.lib /NODEFAULTLIB:libcpd.lib /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libcid.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:libcimt.lib /NODEFAULTLIB:libcimtd.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.lib" /MACHINE:X64 ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.rc
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.res
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgrSvc.dll
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgr.res
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.obj
1>  Tracking command:
1>  C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\Tracker.exe /a /d C:\Windows\Microsoft.NET\Framework\v4.0.30319\FileTracker.dll /i S:\twk_results_win\ViewLocal\x64\MC_inter\EditorServiceMgr\Debug /r "S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGR.RES|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.H|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.OBJ|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.RC|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.RES|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_OUT\DEBUG\EDITORSERVICEMGRSVC.DLL" /b MSBuildConsole_CancelEvent31ad2214810446c299127f83382c747d  /c "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\link.exe"  /ERRORREPORT:PROMPT /OUT:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.exe" /INCREMENTAL /NOLOGO /LIBPATH:S:\twk_amf\Implementation\EditorServiceMgr\proj\Win\vc9\..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\..\..\..\..\..\..\external\Trolltech_Qt4\lib\win\x64\Debug msvcrtd.lib QtCored4.lib QtGuid4.lib QtXmld4.lib QtNetworkd4.lib QtUiToolsd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcp.lib /NODEFAULTLIB:libcpd.lib /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libcid.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:libcimt.lib /NODEFAULTLIB:libcimtd.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.lib" /MACHINE:X64 ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.rc
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.res
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgrSvc.dll
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgr.res
1>  ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.obj
1>..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0x5F2
1>  The command exited with code 1107.
1>Done executing task "Link" -- FAILED.

从构建输出中,我认为链接器可能正在尝试链接头文件,但我无法找到任何证据。

此处引用的文件EditorServiceMgrSvc.h仅包含宏定义,不包含。头文件也在rc文件中引用,并作为符号头文件包含在内。此外,项目属性页的附加依赖项中只有库。

如果需要的话,除了构建输出之外,我会提出我能做的事情,但是因为我正在研究专有代码,所以我可能无法忍受这么多。关于这里发生了什么的任何想法?

修改:
请注意,此项目是从Visual Studio 2008项目格式自动转换的。

0 个答案:

没有答案