在用VC6.0寫(xiě)程序調(diào)試時(shí),,初學(xué)者總是會(huì)遇到一些錯(cuò)誤,,針對(duì)如下錯(cuò)誤主要是因?yàn)镸FC類庫(kù)沒(méi)有引用所出現(xiàn)的問(wèn)題。 nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex Debug/jnHid.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. 解決錯(cuò)誤的方法: 選擇Project-Settings--General--Microsoft foundation Classes 下拉列表中有三個(gè)選項(xiàng): 1,、Not using MFC 2,、Use MFC in a Static Libray 3、Use MFC in a Shared DLL 錯(cuò)誤提示: nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Hello.exe : fatal error LNK1120: 3 unresolved externals 第一種解決方法: 1、“Project”->“settings”->“c/c++”“Catagory” 選擇“Code Generation”“use run-time library”選擇“debug multithreaded” 此時(shí)確定一般解決問(wèn)題,,也有可能出現(xiàn)如下問(wèn)題提示: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Hello.exe : fatal error LNK1120: 1 unresolved externals 此時(shí),,進(jìn)行第二步操作: 2、 [Project] --> [Settings] --> 選擇"Link"屬性頁(yè),在Project Options中將/subsystem:console改成/subsystem:windows 溫馨提示:在Project Options窗口,,右邊滑動(dòng)條向下滑動(dòng)就會(huì)找到該項(xiàng),! 總結(jié):進(jìn)行以上兩步操作后,問(wèn)題解決,! 第二種解決方法: 1.檢查是否包含頭文件afx.h 2.打開(kāi)project->settings->general->microsoft foundation classes->選use MFC in a static library或選 use MFC in a shared DLL(需要把MFC的動(dòng)態(tài)庫(kù)放在system32文件夾下) . |
|