1. 程式人生 > >編譯出錯:fatal error C1001: INTERNAL COMPILER ERROR 和 連結出錯 unresolved external symbol

編譯出錯:fatal error C1001: INTERNAL COMPILER ERROR 和 連結出錯 unresolved external symbol

1.fatal error C1001: INTERNAL COMPILER ERROR

最近在編譯一個VC6.0工程(開發環境:win2000+VS6.0+Sp6),在加入預編譯頭後出現了下面的編譯錯誤提示: c:/program files/microsoft visual studio/vc98/include/xlocnum(106) : fatal error C1001: INTERNAL COMPILER ERROR         (compiler file 'msc1.cpp', line 1794)          Please choose the Technical Support command on the Visual C++          Help menu, or open the Technical Support help file for more information Error executing cl.exe.

 工程中的每個cpp檔案編譯都沒有問題(除了預編譯頭對應的cpp檔案),很是奇怪,於是在網上找了一下,找到下面一種解決辦法:

VC6.0的一個編譯錯誤的解決

在window98下使用vc6.0時,如果預編譯標頭檔案(stdafx.h)中包含了模板類的標頭檔案,比如atl的標頭檔案時,編譯器會報錯: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786)

造成這種問題的原因是編譯器分配的記憶體超過了限制。 解決的辦法有三種: 1.給編譯器增大記憶體限制。在project(工程)->setting(設定)->c/c++的project option(工程選項)中,新增/Zm#nn選項,#nn是一個數字,取值最大為2000。預設為100。但是這種方法好像沒有什麼用處。 2.將模板類標頭檔案從stdafx.h中移出; 3.不使用預編譯標頭檔案。project->setting->c/c++,選擇所有的.cpp檔案,都使用“不使用預編譯標頭檔案“的選項。缺點是編譯的時候很慢。

還有一個英文的:

I see that while compiling ITEL.CPP it is trying and failing to open Debug/IODIARY.PCH. I also see that there is no IODIARY.CPP. Exactly how is IODIARY.PCH supposed to be created? Turn off precompiled headers for all files in the project, and rebuild. If the build still fails, then... uh-oh.. Modify the project to use the default STDAFX.CPP/STDAFX.H method of using PCH. Then, add an empty file STDAFX.H and an empty file STDAFX.CPP to the project. Then, for each .CPP file, add as the first line #include "stdafx.h" . Then compile. This should work. If it does not... uh-oh. In order for pre-compiled headers to work properly each .CPP must have as its first #include statement the name of the one .H (such as STDAFX.H) that includes all the "actual" .H's (

windows.h, stdio.h, etc.) that should be included by ALL .CPPs. That is the important part. You don't usually want EVERYsingle .H that is included in ANY .CPP in the project to be in STDAFX.H -- you do normally want windows.h, because it is the big one that can include a lot and is usually included in every .CPP. Putting just windows.h in stdafx.h (and removing it from all the .CPPs) can speed up the build tremendously. http://www.codecomments.com/archive307-2005-3-421145.html

在MSDN中搜索到這種錯誤相關主題:

後來把預編譯去掉後,Build終於通過了運行了,可這也太慢了,鬱悶中……

還不知有沒更好的解決辦法??同樣的工程放在VC++.net2003中卻編譯順利通過,執行正常.!!!!

2.unresolved external symbol [email protected]

下載原始碼後連結出了問題,提示如上所示

在網上找到了解決方法

一,問題描述error LNK2001: unresolved external symbol _WinMainᤐdebug/main.exe:fatal error LNK 1120:1 unresolved externals error executing link.exe;

二,產生這個問題可能的原因

1, 你用vc建了一個控制檯程式,它的入口函式應該是main, 而你使用了WinMain.

2.  你用vc打開了一個.c/.cpp 檔案,然後直接編譯這個檔案,這個檔案中使用了WinMian而不是main作為入口函式。vc這時的預設設定是針對控制檯程式的。

三, 解決方法

1.進入project->setting->c/c++, 在category中選擇preprocessor,在processor definitions中刪除_WINDOWS, 新增_CONSOLE

2.進入project->setting->Link, 在Project options中將/subsystem:windows.改為/subsystem:console

3.儲存設定,Rebuild All. 

相關推薦

編譯出錯fatal error C1001: INTERNAL COMPILER ERROR 連結出錯 unresolved external symbol <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfem

1.fatal error C1001: INTERNAL COMPILER ERROR 最近在編譯一個VC6.0工程(開發環境:win2000+VS6.0+Sp6),在加入預編譯頭後出現了下面的編譯錯誤提示: c:/program files/microsoft visua

[Visual Studio C++] [MFC 除錯錯誤]error LNK2019: 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c09f9fa9adb09f9fb4a9a

1.編譯問題描述:  error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: unsigned int __thiscall CMultimediatimerDlg::CreateTimer(void)" ([em

opencv error undefined reference to `<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e7b3aea1a1b5828683a38e9582849388959ea7a

ubuntu16.04,在make opencv3.4.0 的時候,出現以下錯誤 解決方法: 參考:https://blog.csdn.net/wangchuansnnu/article/details/44241199  在 cmake 時,新增 cmake -D

[Visual Studio C++] [MFC 除錯錯誤]error LNK2019: 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ed1d1e7e3fed1d1fae7e

1.編譯問題描述:錯誤    3    error LNK2019: 無法解析的外部符號 [email protected],該符號在函式 "public: unsigned int __thiscall CMultimediatimerDlg::CreateTim

win10 QtCreator5.10 編譯opengl出現 error: undefined reference to `<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="17487e7a6748487

1、在pro檔案中新增:  LIBS += -lopengl32 -lGLU32 -lglut 2、在程式中新增以下3個頭檔案: 3、下載glut32庫,(已上傳到本地),解壓出現以下5個檔案 為簡單起見,複製全部檔案到安裝路徑的三個地方:      

mysql叢集出現Last_IO_Error: error connecting to master '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="493b2c392509313131">

網上的經驗:網路不同,賬號密碼不對,密碼太長,密碼由 # 字元;檢查MASTER_HOST,MASTER_USER,MASTER_PASSWORD(不知道 MASTER_LOG_FILE 有沒有影響) 但是,對我都沒用,突然想起來用navicat登陸mysql時出現報錯:   client does no

RabbitMQ_____error rabbitMQError: unable to perform an operation on node '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail

Error: unable to perform an operation on node '[email protected]' 將登入身份改為指定帳戶,重啟RabbitMq服務 Error: unable to perform an operation on node '

github解決hexo d命令出錯error: 推送一些引用到 '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d7b0bea397b0bea3bfa2b5f9b4b8ba">[email&

error: 推送一些引用到 '[email protected]:xxxx.github.io.git' 失敗 FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/tro

Android Studio 3.0.1 gradle編譯報錯 Error : unable to resolve dependency for <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a0c1

在app目錄下build.gradle中引用了第三方類庫,gradle編譯時不斷報錯,無法resolve第三方類庫,或者無法download第三方類庫dependencies { implementation fileTree(include: ['*.jar'],

DLL檔案編譯出錯<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c49b80a8a889a5adaa84f5f6">[email protected]a> already defined

編譯MFC DLL程式時出現 Error2error LNK1169: one or more multiply defined symbols foundE:\C++\HookTest\CopyFi

編譯caffe 遇到error LNK2019: 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="633c3c0a0e133c3c3302170b2e0217000b30130600

這是在gflags中的,由於google為了相容windows xp之前的系統 在config.h中有 // Define if you have the <shlwapi.h> h

[轉]在vs2008上編譯獲取cpu程式碼出現的錯誤- error LNK2019: 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="91ced6f4e5c1e3fef2f4e2e2

1>正在連結...1>LINK : 沒有找到 E:\yy\20110112\cpuproject\cpu\Debug\cpu.exe 或上一個增量連結沒有生成它;正在執行完全連結1>cpu.obj : error LNK2019: 無法解析的外部符號 ,該符號在函式 "void __cde

linux bash Shell特殊變數Shell $0, $#, $*, <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8aaeca">[email protected]a>, $?

在linux下配置shell引數說明 前面已經講到,變數名只能包含數字、字母和下劃線,因為某些包含其他字元的變數有特殊含義,這樣的變數被稱為特殊變數。  例如,$ 表示當前Shell程序的ID,即pid,看下面的程式碼: [[email protected] /]$ ec

啟動hbase後,出現ERROR [<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a4b4f49484b4d4d4a4c493a0b0e0a574f4d494b4a4842424b5748">[em

2018-11-07 09:28:54,771 INFO [master:16000.activeMasterManager] util.FSUtils: Waiting for dfs to exit safe mode... 2018-11-07 09:29:04,783 INFO [mas

【原創】叢集搭建報“Error unable to connect to nodes ['<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96e4f7f4f4ffe2d6e4fbe7bbf8a7

在rabbitmq叢集搭建時,將rmq-n2和rmq-n3兩節點加入rmq-n1時,報如下錯: 解決辦法: rabbitmq叢集是基於erlang叢集的,而erlang叢集中各節點間的通訊是通過4369埠和25672埠來進行通訊的, 所以:防火牆開啟4369埠和25672埠&nbs

挖坑指南iView Select的<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d798a7a3beb8b997b4bbbeb4bc">[email protected]a>事件無效

前言 日常挖坑。。 開始 上車。。 實踐 bug描述:Select元件,設定了filterable和remote,前端啟用模糊查詢。期望在使用者選擇某一結果項時,獲取選擇的物件。給Option綁定了點選事件,但是並未生效。 為什麼呢? 應該是元件自身做了事件監聽。 那

mfcs100ud.lib(dllmodul.obj) : error LNK2005: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="da859eb6b697bbb3b49aebe8">[email

今天用VC2010寫一個用了MFC的規則DLL,編譯時報告如題錯誤。 必應後發現這篇文章  error LNK2005: [email protected] 已經在 MSVCRTD.lib(dllmain.obj) 中定義   http://wangl

VS2015 error LNK2019 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="19464e70775478707759282f">[email protecte

前言 上一篇文章中,為了編譯OpenCV的示例程式碼,然後搭建環境, 最後想直接執行示例demo,我在建立新工程的時候,直接建立了一個win32視窗專案,然後環境配置完成後,將opencv 的示例程式碼kalman.cpp直接匯入到新建的vs工程中進行編譯,直接報錯: 錯誤 LN

error LNK2019: 無法解析的外部符號 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="702f031f131b1504304142">[email protected]a>,該

Reason: 學習使用socket,在stdafx.h檔案加了#include ,編譯 #include "stdafx.h" #include   using namespace std;   int _tmain(int argc

【轉載】解決方案<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2f48465b6f48465b475a4d014c4042">[email protected]a>出現Permissi

遇到的問題 今天心血來潮,想將intellij上的專案程式碼放到GitHub上管理。 在進行新增遠端庫的時候,出現了:[email protected]出現Permission denied (publickey) 原因是 ./ssh目錄預設在C:\Users\VULCAN\.ssh,而我