所以我找了近2天了一個解決我的問題,只是大家都收到這個錯誤似乎是鏈接到的DLL而不是庫。但是,這似乎並不適合我,所以我就是這樣。VC11 LNK1107引用頭文件
我試圖建立一個使用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的項目格式自動轉換。
我想你已經閱讀過這篇文章,但是如果你還沒有鏈接的話:[Linker Tools Error LNK1107](http://msdn.microsoft.com/en-us/library/0h6ctxtk%28v=vs .110%29.aspx) – jpw
是的,不幸的是,這兩種情況似乎都不適用。 – Josh
構建輸出肯定說你正在嘗試鏈接一個頭文件。你可以仔細檢查你的項目和它的設置嗎? –