锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _printf already defined in xlibgui.lib(PRINTF.OBJ)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _signal already defined in LIBCMTD.lib(winsig.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __controlfp already defined in LIBCMTD.lib(ieee87.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _getenv already defined in LIBCMTD.lib(getenv.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _free already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _calloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _malloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _printf already defined in xlibgui.lib(PRINTF.OBJ); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _fflush already defined in LIBCMTD.lib(fflush.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _sprintf already defined in LIBCMTD.lib(sprintf.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _strncpy already defined in LIBCMTD.lib(strncpy.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _atoi already defined in LIBCMTD.lib(atox.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _realloc already defined in LIBCMTD.lib(dbgheap.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _signal already defined in LIBCMTD.lib(winsig.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: __controlfp already defined in LIBCMTD.lib(ieee87.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _exit already defined in LIBCMTD.lib(crt0dat.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _fclose already defined in LIBCMTD.lib(fclose.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _fopen already defined in LIBCMTD.lib(fopen.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: __stricmp already defined in LIBCMTD.lib(stricmp.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _fprintf already defined in LIBCMTD.lib(fprintf.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: _ceil already defined in LIBCMTD.lib(ceil.obj); second definition ignored
Creating library Debug/shm_ext_sim.lib and object Debug/shm_ext_sim.exp
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/shm_ext_sim.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
shm_ext_sim.exe - 37 error(s), 86 warning(s)
緗戝弸錛?strong>鏈珯緗戝弸
鏃墮棿錛?006-08-27 14:24:11 IP鍦板潃錛?02.194.210.鈽?
For example, if you received this warning and you want to create an executable file that uses the non-debug, single-threaded version of the run-time libraries, you could use the following options with the linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
鎴栬呰繖鏍鳳細For example, if you received this warning and you want to create an executable file that uses the non-debug, single-threaded version of the run-time libraries, you could use the following options with the linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB鍐欑▼搴忕湅鍒?warning錛屾劅瑙変笉鐖姐?榪欎釜璀﹀憡鍦?link option 涓?鍔犲叆 瀵瑰簲鐨?/NODEFAULTLIB:xxx.lib 銆銆灝眔k浜?br>
]]>
浠婂ぉ鍦ㄦ敼涓涓緢澶х殑紼嬪簭錛屾參鎱㈢湅錛屾參鎱㈡敼銆傜獊鐒跺彂鐜頒竴涓?c鏂囦歡錛岄噷闈粈涔堜篃娌℃湁錛?灝卞嚑涓ご鏂囦歡錛屾垜涓鐪嬶紝鎴戦潬錛岃繖涓嶆槸鎶婄畝鍗曠殑闂鎼炲鏉備簡鍚楋紝闅忔墜鍒犳帀閭d釜c鏂囦歡銆?緇撴灉涓嶈兘緙栬瘧浜嗭紝鎴戦潬錛?
fatal error C1083: Cannot open precompiled header file: Debug/v13_3.pch\': No such file or directory
鎬庝箞rebuild all閮戒笉琛屻?涓婄綉鏌ヤ簡涓涓嬶紝鎵嶆悶鎳備簡錛?
錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞鎬葷粨錛嶏紞錛嶏紞錛嶏紞
濡傛灉宸ョ▼寰堝ぇ錛屽ご鏂囦歡寰堝錛岃屾湁鍑犱釜澶存枃浠跺張鏄粡甯歌鐢ㄧ殑錛岄偅涔?
1銆傛妸榪欎簺澶存枃浠跺叏閮ㄥ啓鍒頒竴涓ご鏂囦歡閲岄潰鍘伙紝姣斿鍐欏埌preh.h
2銆傚啓涓涓猵reh.c錛岄噷闈㈠彧涓鍙ヨ瘽錛?include "preh.h"
3銆傚浜巔reh.c錛屽湪project setting閲岄潰璁劇疆creat precompiled headers錛屽浜庡叾浠?.c鏂囦歡錛岃緗畊se precompiled header file
// 鍝堝搱 鎴戣瘯浜嗕竴涓嬶紝鏁堟灉寰堟槑鏄撅紝涓嶇敤precompiled header錛岀紪璇戜竴嬈℃垜鍙互鍘諱笂涓帟鎵錛岀敤 precompiled header錛岀紪璇戠殑鏃跺欙紝鎴戝彲浠ョ珯璧鋒潵浼鎬釜鎳掕叞錛屾椿鍔ㄦ椿鍔ㄥ氨宸笉澶氬暒
錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛?-錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞
棰勭紪璇戝ご鐨勬蹇碉細 鎵璋撶殑棰勭紪璇戝ご灝辨槸鎶婁竴涓伐紼嬩腑鐨勯偅涓閮ㄥ垎浠g爜,棰勫厛緙栬瘧濂芥斁鍦ㄤ竴涓枃浠墮噷(閫氬父鏄?浠?pch涓烘墿灞曞悕鐨?錛岃繖涓枃浠跺氨縐頒負棰勭紪璇戝ご鏂囦歡榪欎簺棰勫厛緙栬瘧濂界殑浠g爜鍙互鏄換浣曠殑 C/C++浠g爜--------鐢氳嚦鏄痠nline鐨勫嚱鏁幫紝浣嗘槸蹇呴』鏄ǔ瀹氱殑錛屽湪宸ョ▼寮鍙戠殑榪囩▼涓笉浼?琚粡甯告敼鍙樸傚鏋滆繖浜涗唬鐮佽淇敼錛屽垯闇瑕侀噸鏂扮紪璇戠敓鎴愰緙栬瘧澶存枃浠躲傛敞鎰忕敓鎴愰緙?璇戝ご鏂囦歡鏄緢鑰楁椂闂寸殑銆傚悓鏃朵綘寰楁敞鎰忛緙栬瘧澶存枃浠墮氬父寰堝ぇ錛岄氬父鏈?-7M澶с傛敞鎰忓強鏃舵竻鐞嗛偅浜涙病鏈夌敤鐨勯緙栬瘧澶存枃浠躲?
涔熻浣犱細闂細鐜板湪鐨勭紪璇戝櫒閮芥湁Time stamp鐨勫姛鑳斤紝緙栬瘧鍣ㄥ湪緙栬瘧鏁翠釜宸ョ▼鐨勬椂鍊欙紝瀹冨彧浼氱紪璇戦偅浜涚粡榪囦慨鏀圭殑鏂囦歡錛岃屼笉浼氬幓緙栬瘧閭d簺浠庝笂嬈$紪璇戣繃錛屽埌鐜板湪娌℃湁琚慨鏀硅繃鐨勬枃浠躲傞偅涔堜負浠涔堣繕瑕侀緙栬瘧澶存枃浠跺憿錛熺瓟妗堝湪榪欓噷錛屾垜浠煡閬撶紪璇戝櫒鏄互鏂囦歡涓哄崟浣嶇紪璇戠殑錛屼竴涓枃浠剁粡榪囦慨鏀瑰悗錛屼細閲嶆柊緙栬瘧鏁翠釜鏂囦歡錛屽綋鐒跺湪榪欎釜鏂囦歡閲屽寘鍚殑鎵鏈夊ご鏂囦歡涓殑涓滆タ錛?eg Macro, Preprocesser 錛夐兘瑕侀噸鏂板鐞嗕竴閬嶃俈C鐨勯緙栬瘧澶存枃浠朵繚瀛樼殑姝f槸榪欓儴鍒嗕俊鎭備互閬垮厤姣忔閮借閲嶆柊澶勭悊榪欎簺澶存枃浠躲?
棰勭紪璇戝ご鐨勪綔鐢細鏍規嵁涓婃枃浠嬬粛錛岄緙栬瘧澶存枃浠剁殑浣滅敤褰撶劧灝辨槸鎻愰珮渚垮疁閫熷害浜嗭紝鏈変簡瀹冧綘娌℃湁蹇呰姣忔閮界紪璇戦偅浜涗笉闇瑕佺粡甯告敼鍙樼殑浠g爜銆傜紪璇戞ц兘褰撶劧灝辨彁楂樹簡銆?
棰勭紪璇戝ご鐨勪嬌鐢細瑕佷嬌鐢ㄩ緙栬瘧澶達紝鎴戜滑蹇呴』鎸囧畾涓涓ご鏂囦歡錛岃繖涓ご鏂囦歡鍖呭惈鎴戜滑涓嶄細緇忓父鏀瑰彉鐨勪唬鐮佸拰鍏朵粬鐨勫ご鏂囦歡錛岀劧鍚庢垜浠敤榪欎釜澶存枃浠舵潵鐢熸垚涓涓緙栬瘧澶存枃浠訛紙.pch鏂囦歡錛?/p>
鎯沖繀澶у閮界煡閬?StdAfx.h榪欎釜鏂囦歡銆傚緢澶氫漢閮借涓鴻繖鏄疺C鎻愪緵鐨勪竴涓?#8220;緋葷粺綰у埆”鐨勶紝緙栬瘧鍣ㄥ甫鐨勪竴涓ご鏂囦歡銆傚叾瀹炰笉鏄殑錛岃繖涓枃浠跺彲浠ユ槸浠諱綍鍚嶅瓧鐨勩傛垜浠潵鑰冨療涓涓吀鍨嬬殑鐢盇ppWizard鐢熸垚鐨凪FC Dialog Based銆紼嬪簭鐨勯緙栬瘧澶存枃浠躲傦紙鍥犱負AppWizard浼氫負鎴戜滑鎸囧畾濂藉浣曚嬌鐢ㄩ緙栬瘧澶存枃浠訛紝榛樿鐨勬槸StdAfx.h錛岃繖鏄疺C璧風殑鍚嶅瓧錛夈傛垜浠細鍙戠幇榪欎釜澶存枃浠墮噷鍖呭惈浜嗕互涓嬬殑澶存枃浠訛細
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4
Common Controls
#include <afxcmn.h>
榪欎簺姝f槸浣跨敤MFC鐨勫繀欏誨寘鍚殑澶存枃浠訛紝褰撶劧鎴戜滑涓嶅お鍙兘鍦ㄦ垜浠殑宸ョ▼涓慨鏀硅繖浜涘ご鏂囦歡鐨勶紝鎵浠ヨ浠栦滑鏄ǔ瀹氱殑銆?
閭d箞鎴戜滑濡備綍鎸囧畾瀹冩潵鐢熸垚棰勭紪璇戝ご鏂囦歡銆傛垜浠煡閬撲竴涓ご鏂囦歡鏄笉鑳界紪璇戠殑銆傛墍浠ユ垜浠繕闇瑕佷竴涓猚pp鏂囦歡鏉ョ敓鎴?pch 鏂囦歡銆傝繖涓枃浠墮粯璁ょ殑灝辨槸StdAfx.cpp銆傚湪榪欎釜鏂囦歡閲屽彧鏈変竴鍙ヤ唬鐮佸氨鏄細#include “Stdafx.h”銆傚師鍥犳槸鐞嗘墍褰撶劧鐨勶紝鎴戜滑浠呬粎鏄瀹冭兘澶熺紪璇戣屽凡?D?D?D涔熷氨鏄錛岃鐨勫彧鏄畠鐨?cpp鐨勬墿灞曞悕銆傛垜浠彲浠ョ敤/Yc緙栬瘧寮鍏蟲潵鎸囧畾StdAfx.cpp鏉ョ敓鎴愪竴涓?pch鏂囦歡錛岄氳繃/Fp緙栬瘧寮鍏蟲潵鎸囧畾鐢熸垚鐨刾ch鏂囦歡鐨勫悕瀛椼?br>
鎵撳紑project ->Setting->C/C++ 瀵硅瘽妗嗐傛妸Category鎸囧悜Precompiled Header銆傚湪宸﹁竟鐨勬爲褰㈣鍥鵑噷閫夋嫨鏁翠釜宸ョ▼Project Options(鍙充笅瑙掔殑閭d釜鐧界殑鍦版柟)鍙互鐪嬪埌 /Fp “debug/PCH.pch”錛岃繖灝辨槸鎸囧畾鐢熸垚鐨?pch鏂囦歡鐨勫悕瀛楋紝榛樿鐨勯氬父鏄<宸ョ▼鍚?gt;.pch錛堟垜鐨勭ず渚嬪伐紼嬪悕灝辨槸PCH錛夈傜劧鍚庯紝鍦ㄥ乏杈圭殑鏍戝艦瑙嗗浘閲岄夋嫨StdAfx.cpp.//榪欐椂鍙兘閫変竴涓猚pp鏂囦歡錛佽繖鏃跺師鏉ョ殑Project Option鍙樻垚浜?Source File Option錛堝師鏉ユ槸宸ョ▼錛岀幇鍦ㄦ槸涓涓枃浠訛紝褰撶劧鍙樹簡錛夈傚湪榪欓噷鎴戜滑鍙互鐪嬪埌 /Yc寮鍏籌紝/Yc鐨勪綔鐢ㄥ氨鏄寚瀹氳繖涓枃浠舵潵鍒涘緩涓涓狿ch鏂囦歡銆?Yc鍚庨潰鐨勬枃浠跺悕鏄偅涓寘鍚簡紼沖畾浠g爜鐨勫ご鏂囦歡錛屼竴涓伐紼嬮噷鍙兘鏈変竴涓枃浠剁殑鍙互鏈塝C寮鍏熾俈C灝辨牴鎹繖涓夐」鎶?StdAfx.cpp緙栬瘧鎴愪竴涓狾bj鏂囦歡鍜屼竴涓狿CH鏂囦歡銆傜劧鍚庢垜浠啀閫夋嫨涓涓叾瀹冪殑鏂囦歡鏉ョ湅鐪嬶紝//鍏朵粬cpp鏂囦歡鍦ㄨ繖閲岋紝Precomplier 閫夋嫨浜?Use 鈰嫰鈰竴欏癸紝澶存枃浠舵槸鎴戜滑鎸囧畾鍒涘緩PCH 鏂囦歡鐨剆tdafx.h鏂囦歡銆備簨瀹炰笂錛岃繖閲屾槸浣跨敤宸ョ▼閲岀殑璁劇疆錛?/Yu”stdafx.h”銆傝繖鏍鳳紝鎴戜滑灝辮緗ソ浜嗛緙栬瘧澶存枃浠躲備篃灝辨槸璇達紝鎴戜滑鍙互浣跨敤棰勭紪璇戝ご鍔熻兘浜嗐?br>
浠ヤ笅鏄敞鎰忎簨欏癸細
1):濡傛灉浣跨敤浜?Yu錛屽氨鏄浣跨敤浜嗛緙栬瘧錛屾垜浠湪姣忎釜.cpp鏂囦歡鐨勬渶寮澶達紝鎴戝己璋冧竴閬嶆槸鏈寮澶達紝鍖呭惈 浣犳寚瀹氫駭鐢焢ch鏂囦歡鐨?h鏂囦歡錛堥粯璁ゆ槸stdafx.h錛変笉鐒跺氨浼氭湁闂銆傚鏋滀綘娌℃湁鍖呭惈榪欎釜鏂囦歡錛屽氨鍛婅瘔浣燯nexpected file end. 濡傛灉浣犱笉鏄湪鏈寮澶村寘鍚殑錛屼綘鑷繁璇曚互涓嬪氨鐭ラ亾浜嗭紝緇濆鏈夊緢鎯婁漢鐨勬晥鏋溾嫰..
fatal error C1010: unexpected end of file while looking for precompiled header directive Generating Code...
2錛夊鏋滀綘鎶妏ch鏂囦歡涓嶅皬蹇冧涪浜嗭紝緙栬瘧鐨勬椂鍊欏氨浼氫駭鐢熷緢澶氱殑涓嶆甯哥殑琛屼負銆傛牴鎹互涓婄殑鍒嗘瀽錛屼綘鍙璁╃紪璇戝櫒鐢熸垚涓涓猵ch鏂囦歡銆備篃灝辨槸璇存妸 stdafx.cpp錛堝嵆鎸囧畾/Yc鐨勯偅涓猚pp鏂囦歡錛変粠鏂扮紪璇戜竴閬嶃傚綋鐒朵綘鍙互鍌誨偦鐨?Rebuild All銆傜畝鍗曚竴鐐瑰氨鏄夋嫨閭d釜cpp鏂囦歡錛屾寜涓涓婥trl + F7灝卞彲浠ヤ簡銆備笉鐒跺彲鏄緢嫻垂鏃墮棿鐨勫摝銆?
棣栧厛鎵撳紑鑿滃崟 欏圭洰->欏圭洰灞炴?(Alt+F7)欏?
1 閫夋嫨閰嶇疆灞炴?>閾炬帴鍣?>璋冭瘯->鐢熸垚璋冭瘯淇℃伅鏀逛負鏄?/strong>
2 閫夋嫨 閰嶇疆灞炴?>C/C++ ->甯歌->璋冭瘯淇℃伅鏍煎紡鏀逛負鐢ㄤ簬“緙栬緫騫剁戶緇?#8221;鐨勭▼搴忔暟鎹簱(/ZI)
3 閫夋嫨 閰嶇疆灞炴?>C/C++ ->浼樺寲->浼樺寲 鏀逛負 鑷畾涔?/strong>
閲嶆柊緙栬瘧錛岃繍琛?ok
鑳芥煡鍒扮殑瑙e喅鏂規硶閮藉湪閲岄潰鏈夋彁鍙?
鎴戞槸浣跨敤 stdafx.h鍔犲叆榪欏彞
code #pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\"") 瑙e喅鐨?nbsp;
vs2008鐨勮瘽鏀規垚VC90.CRT
version='8.0.50608.0' 鏀規垚浣犵殑vs鐨勭増鏈?
浠ヤ笅鏄漿杞界殑鍏ㄦ枃
涓涓」鐩粠vc6榪佺Щ鍒癡S2005錛屽湪淇敼浜嗕竴緋誨垪鐨勭被鍨嬭鍛婂悗銆傜紪璇戞垚鍔熶簡錛孌ebug鐨勬椂鍊欙紝緇撴灉鍗村啋鍑轟竴涓猂6034閿欒錛?An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
Output Window:app.exe 涓殑 0x7c984ed1 澶勬渶鍙兘鐨勫紓甯? 0xC0000142: DLL Initialization Failed銆?br> 緙栬瘧鏉′歡鏄細Linker->Manifest File ->Allow Isolation:Yes銆?