VC 6.0編譯器錯誤整理

來源:互聯網
上載者:User

1. 【錯誤提示】: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main 
    【說      明】: Windows項目要使用Windows子系統, 而不是Console 
    【解決方案】:[Project] --> [Settings] --> 選擇"Link"屬性頁面,
                       在Project Options中將/subsystem:console改成/subsystem:windows

2. 【錯誤提示】:LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 
    【說      明】:控制台項目要使用Console子系統, 而不是Windows 
    【解決方案】:[Project] --> [Settings] --> 選擇"Link"屬性頁面,
                       在Project Options中將/subsystem:windows改成/subsystem:console

3. 【錯誤提示】:msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 
    【說      明】:通常, MFC項目的程式入口函數是WinMain, 如果編譯項目的Unicode版本, 程式入                       口必須改為wWinMainCRTStartup, 所以需要重新設定程式入口 
    【解決方案】:[Project] --> [Settings] --> 選擇"C/C++"屬性頁面,
                       在Category中選擇Output,
                       再在Entry-point symbol中填入wWinMainCRTStartup, 即可 4. 【錯誤提示】:nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
                       nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex 
    【說      明】:這是因為MFC要使用多線程時庫    【解決方案】:[Project] --> [Settings] --> 選擇"C/C++"屬性頁面,
                       在Category中選擇Code Generation,
                       再在Use run-time library中選擇Debug Multithreaded或者multithreaded
                       其中, 
                       Single-Threaded 單線程靜態連結庫(release版本)
                       Multithreaded 多線程靜態連結庫(release版本)
                       multithreaded DLL 多線程動態連結程式庫(release版本)
                       Debug Single-Threaded 單線程靜態連結庫(debug版本)
                       Debug Multithreaded 多線程靜態連結庫(debug版本)
                       Debug Multithreaded DLL 多線程動態連結程式庫(debug版本)
                       單線程: 不需要多線程調用時, 多用在DOS環境下
                       多線程: 可以並發運行
                       靜態庫: 直接將庫與程式Link, 可以脫離MFC庫運行
                       動態庫: 需要相應的DLL動態庫, 程式才能運行
                       release版本: 正式發布時使用 
                       debug版本: 調試階段使用5. 【錯誤提示】:Compiling... ,Error spawning cl.exe    【說      明】:這個問題很多情況下是由於路徑設定的問題引起的,“CL.exe”是VC使用真正                       的編譯器(編譯器),其路徑在“VC根目錄/VC98/Bin”下面,你可以到相                       應的路徑下找到這個應用程式。
    【解決方案】:“TOOLS(工具)”—>“Option(選擇)”—>“Directories(目錄)”                       重新設定“Excutable Fils、Include Files、Library Files、Source Files”的路徑。6. 【錯誤提示】:nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
    【說      明】:    【解決方案】:在Preprocessor中定義_AFXDLL7. 【錯誤提示】:fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds    【說      明】:    【解決方案】:/C++->Code Generation->Multithread DLL (即實現/MD選項)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.