當前位置:首頁 » 編程軟體 » 編譯gcc112的問題

編譯gcc112的問題

發布時間: 2023-03-27 09:38:17

linux0.11gcc編譯報錯怎麼查看全部報錯

在Linux 0.11中使用gcc編配沒譯時,如果出現報錯,可以使用以下命令查看全部報錯:
```
make >缺做 log.txt 2>&1
```
這個命令將編譯過程中的所有輸出信息保存到log.txt文件中,包括錯誤信息和警告信息。可以使用文本編輯器打開這個文件,查看其中的錯誤信息,以便進行調試和修復。
另外,如果只想查看錯誤信息,培扮納可以使用以下命令:
```
make 2> error.txt
```
這個命令將編譯過程中的錯誤信息保存到error.txt文件中,可以使用文本編輯器打開這個文件,查看其中的錯誤信息。

㈡ 請教關於gcc編譯文件時遇到C11支持的問題

由於系統比較復雜,首先用VC++.NET 2005 開發,在PC測試全部通過後,使用GCC編譯時出現了兩個警告,調試時出現一個錯誤.請高手指教:
1.編譯器警告
Queue.h:20: warning: ignoring packed attribute on unpacked non-POD field `CommandPackage Queue::cmd[1]
請教原因
2.編譯器警告
buffer.h:12: warning: alignment of 'Buffer::_ZTV6Buffer' is greater than maximum object file alignment. Using 1
3.調試器報錯
AVR Simulator: Excessive stack overflow, stop sim

簡單說明下程序的情況:
程序用了面向對象的設計,總共涉及了大約10+個類.其中報錯了的是指令緩沖相關類.
Buffer繼承出了E2PBuffer和CommBuffer,在類內部使用了一個CommandPackage(non-POD)類型組成的Queue類.其中Buffer及其兩個子類還有Queue均報了以上兩個警告.
我CommandPackage的大小是 10 Byte,緩沖隊列最大數量是5,緩沖隊列一共產生了6個實例.
由於編譯器不支持new和delete,所有對象在全局實例化.並通過函數初始化函數將引用傳進類

㈢ mac下gcc編譯出現問題,求助,在線等

錯誤提示:
mac gcc Undefined symbols for architecture x86_64 "std::__1:
//
Undefined symbols for architecture x86_64:
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in Person-c78205.o
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in Person-c78205.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std:
...
---------
//
gcc 開啟使用標准c++庫即可
比如:
gcc -lstdc++ Person.cpp -o Person

㈣ 關於gcc編譯出錯的問題!

段錯誤,肯定是非法使用指針。檢查你的指針是不是越界了吧。
程序很亂,剛看清楚,b指針指向的字元串是const類型,是不能被修改的,所以你的函數是錯誤的!

㈤ linux下編譯gcc的一個問題

In function 『read_rtx』:../../gcc/read-rtl.c:653: error: lvalue required as increment operandmake[1]:
你找到文件read-rtl.c的第653行看一下,
順便問一下,你要在linux編譯安裝gcc嗎

㈥ gcc編譯鏈接文件耗時

GCC 編譯鏈接文件耗時可能受多種因素影響,以下是一些可能的原因和解決方法:

大規模代碼庫:如果您的代碼庫很殲蔽大,例如包含大量源文件、頭文件和庫文件,那神改森么編譯鏈接時需要的時間就會更長。您可以考慮使用增量編譯,只編譯發生更改的文件,以縮短編譯鏈接時間。

編譯器選項:某些編譯器選項可能會影響編譯鏈接的時間。例如,啟用優化選項可能會使編譯鏈接時間更長。您可以嘗試調整編譯器選項來優化編譯鏈接時間。例如,可以使用 -O0 選項關閉優化。但是,請注意,關閉優化可能會影響代碼的性能和效率。

硬體配置:編譯鏈接時間也可能受到硬體配置的影響。如果您的計算機配置較低,例如 CPU、內存和硬碟空間較小,那麼編譯鏈接時間可能會更長。您可以嘗試升級硬游畝件配置,例如增加內存和更換更快的硬碟。

多線程編譯:GCC 支持多線程編譯,可以同時編譯多個源文件,從而加快編譯鏈接時間。您可以使用 -j 選項指定要使用的線程數。例如,使用 -j4 選項將使用 4 個線程編譯鏈接。

使用預編譯頭文件:如果您的代碼庫包含大量公共頭文件,可以使用預編譯頭文件來加快編譯鏈接時間。預編譯頭文件包含公共頭文件的預編譯版本,可以在編譯鏈接時重用,從而減少編譯鏈接時間。
總之,GCC 編譯鏈接時間受多種因素影響,您可以嘗試使用上述方法來優化編譯鏈接時間。

㈦ centos使用gcc編譯出的代碼報內存錯誤

如果在CentOS上使用gcc編譯出的代碼報內存錯誤,可能是因為程序中存在內存泄漏或者訪問了未初始化的內存等謹者問題。以下是一些可能的解決方案:

檢查代碼中是否存在內存泄漏。可以使用內存泄漏檢測工具(如Valgrind)來檢查代碼中的內存問題。

檢查代碼中是否訪問了未初始化的內存。可以使用gcc的-Wuninitialized選項來檢查未初始化的變數。

確保代碼中沒有越界訪問漏晌掘數組等問題。

確保代碼中沒有使用野指針或空指針。

嘗試增加程序的內存限制。可以使用ulimit命令來設置程序的內存限制返核。

確保系統中的內存資源足夠,可以嘗試釋放一些不必要的內存資源。

嘗試升級gcc和系統內核等軟體來解決內存問題。

㈧ linux下用gcc編譯c出現的一些問題,請指教

你做 make 的時候,它會用預先設計好的命令來編譯,連接源代碼.你現在直接 "gcc pdf2swf.c" 就是假定整個程序只有這么一個源文件,沒有非標准庫.估計不大可能.很明顯,源文件至少還有一個 init.c.

既然你已經能做 configure, make 和 make install,不知道為什麼還要 gcc pdf2swf.c?

要用 gdb, make 的時候就必須帶有 debug 信息, g++ 是 -g, gcc 不太清楚, 打 gcc --help 查一下. 另外, make 做完後,源文件不能刪掉/移動,否則 gdb 就找不到了.

------------------

configure 會生成一個 Makefile, 打開後找 CCFLAG (通常是這個變數), 加上 -g 後再做 make 應該可以產生 debug 信息.你可以試試看.

㈨ cannot open include file:'math':NO such file or directory怎麼改正

一、這個錯誤的意思就是找不到math這個文件,因為C語言裡面沒有這個文悄段件。這里需要把#include "math" 改為 #include "math.h"或啟鏈譽 #include <math.h>。頭文件一定要以.h文件命令,所以#include 都是.h文件。
二、下面為C語言的錯誤大全及中文解釋:
1: Ambiguous operators need parentheses — 不明確的運算需要用括弧括起
2: Ambiguous symbol xxx — 不明確的符號
3: Argument list syntax error — 參數表語法錯誤
4: Array bounds missing — 丟失數組界限符
5: Array size toolarge — 數組尺寸太大
6: Bad character in paramenters — 參數中有不適當的字元
7: Bad file name format in include directive — 包含命令中文件名格式不正確
8: Bad ifdef directive synatax — 編譯預處理ifdef有語法錯
9: Bad undef directive syntax — 編譯預處理undef有語法錯
10: Bit field too large — 位欄位太長
11: Call of non-function — 調用未定義的函數
12: Call to function with no prototype — 調用函數時沒有函數的說明
13: Cannot modify a const object — 不允許修改常量對象
14: Case outside of switch — 漏掉了case 語句
15: Case syntax error — Case 語法錯誤
16: Code has no effect — 代碼不可能執行到
17: Compound statement missing{ — 分程序漏掉"{"喚純
18: Conflicting type modifiers — 不明確的類型說明符
19: Constant expression required — 要求常量表達式
20: Constant out of range in comparison — 在比較中常量超出范圍
21: Conversion may lose significant digits — 轉換時會丟失意義的數字
22: Conversion of near pointer not allowed — 不允許轉換近指針
23: Could not find file xxx — 找不到XXX文件
24: Declaration missing ; — 說明缺少";"
25: Declaration syntax error — 說明中出現語法錯誤
26: Default outside of switch — Default 出現在switch語句之外
27: Define directive needs an identifier — 定義編譯預處理需要標識符
28: Division by zero — 用零作除數
29: Do statement must have while — Do-while語句中缺少while部分
30: Enum syntax error — 枚舉類型語法錯誤
31: Enumeration constant syntax error — 枚舉常數語法錯誤
32: Error directive :xxx — 錯誤的編譯預處理命令
33: Error writing output file — 寫輸出文件錯誤
34: Expression syntax error — 表達式語法錯誤
35: Extra parameter in call — 調用時出現多餘錯誤
36: File name too long — 文件名太長
37: Function call missing ) — 函數調用缺少右括弧
38: Fuction definition out of place — 函數定義位置錯誤
39: Fuction should return a value — 函數必需返回一個值
40: Goto statement missing label — Goto語句沒有標號
41: Hexadecimal or octal constant too large — 16進制或8進制常數太大
42: Illegal character x — 非法字元x
43: Illegal initialization — 非法的初始化
44: Illegal octal digit — 非法的8進制數字 A
45: Illegal pointer subtraction — 非法的指針相減
46: Illegal structure operation — 非法的結構體操作
47: Illegal use of floating point — 非法的浮點運算
48: Illegal use of pointer — 指針使用非法
49: Improper use of a typedefsymbol — 類型定義符號使用不恰當
50: In-line assembly not allowed — 不允許使用行間匯編
51: Incompatible storage class — 存儲類別不相容
52: Incompatible type conversion — 不相容的類型轉換
53: Incorrect number format — 錯誤的數據格式
54: Incorrect use of default — Default使用不當
55: Invalid indirection — 無效的間接運算
56: Invalid pointer addition — 指針相加無效
57: Irrecible expression tree — 無法執行的表達式運算
58: Lvalue required — 需要邏輯值0或非0值
59: Macro argument syntax error — 宏參數語法錯誤
60: Macro expansion too long — 宏的擴展以後太長
61: Mismatched number of parameters in definition — 定義中參數個數不匹配
62: Misplaced break — 此處不應出現break語句
63: Misplaced continue — 此處不應出現continue語句
64: Misplaced decimal point — 此處不應出現小數點
65: Misplaced elif directive — 不應編譯預處理elif
66: Misplaced else — 此處不應出現else
67: Misplaced else directive — 此處不應出現編譯預處理else
68: Misplaced endif directive — 此處不應出現編譯預處理endif
69: Must be addressable — 必須是可以編址的
70: Must take address of memory location — 必須存儲定位的地址
71: No declaration for function xxx — 沒有函數xxx的說明
72: No stack — 缺少堆棧
73: No type information — 沒有類型信息
74: Non-portable pointer assignment — 不可移動的指針(地址常數)賦值
75: Non-portable pointer comparison — 不可移動的指針(地址常數)比較
76: Non-portable pointer conversion — 不可移動的指針(地址常數)轉換
77: Not a valid expression format type — 不合法的表達式格式
78: Not an allowed type — 不允許使用的類型
79: Numeric constant too large — 數值常太大
80: Out of memory — 內存不夠用
81: Parameter xxx is never used — 能數xxx沒有用到
82: Pointer required on left side of -> — 符號->的左邊必須是指針
83: Possible use of xxx before definition — 在定義之前就使用了xxx(警告)
84: Possibly incorrect assignment — 賦值可能不正確
85: Redeclaration of xxx — 重復定義了xxx
86: Redefinition of xxx is not identical — xxx的兩次定義不一致
87: Register allocation failure — 寄存器定址失敗
88: Repeat count needs an lvalue — 重復計數需要邏輯值
89: Size of structure or array not known — 結構體或數給大小不確定
90: Statement missing ; — 語句後缺少";"
91: Structure or union syntax error — 結構體或聯合體語法錯誤
92: Structure size too large — 結構體尺寸太大
93: Sub scripting missing ] — 下標缺少右方括弧
94: Superfluous & with function or array — 函數或數組中有多餘的"&"
95: Suspicious pointer conversion — 可疑的指針轉換
96: Symbol limit exceeded — 符號超限
97: Too few parameters in call — 函數調用時的實參少於函數的參數不
98: Too many default cases — Default太多(switch語句中一個)
99: Too many error or warning messages — 錯誤或警告信息太多
100: Too many type in declaration — 說明中類型太多
101: Too much auto memory in function — 函數用到的局部存儲太多
102: Too much global data defined in file — 文件中全局數據太多
103: Two consecutive dots — 兩個連續的句點
104: Type mismatch in parameter xxx — 參數xxx類型不匹配
105: Type mismatch in redeclaration of xxx — xxx重定義的類型不匹配
106: Unable to create output file xxx — 無法建立輸出文件xxx
107: Unable to open include file xxx — 無法打開被包含的文件xxx
108: Unable to open input file xxx — 無法打開輸入文件xxx
109: Undefined label xxx — 沒有定義的標號xxx
110: Undefined structure xxx — 沒有定義的結構xxx
111: Undefined symbol xxx — 沒有定義的符號xxx
112: Unexpected end of file in comment started on line xxx — 從xxx行開始的註解尚未結束文件不能結束
113: Unexpected end of file in conditional started on line xxx — 從xxx 開始的條件語句尚未結束文件不能結束
114: Unknown assemble instruction — 未知的匯編結構
115: Unknown option — 未知的操作
116: Unknown preprocessor directive: xxx — 不認識的預處理命令xxx
117: Unreachable code — 無路可達的代碼
118: Unterminated string or character constant — 字元串缺少引號
119: User break — 用戶強行中斷了程序
120: Void functions may not return a value — Void類型的函數不應有返回值
121: Wrong number of arguments — 調用函數的參數數目錯
122: xxx not an argument — xxx不是參數
123: xxx not part of structure — xxx不是結構體的一部分
124: xxx statement missing ( — xxx語句缺少左括弧
125: xxx statement missing ) — xxx語句缺少右括弧
126: xxx statement missing ; — xxx缺少分號
127: xxx declared but never used — 說明了xxx但沒有使用
128: xxx is assigned a value which is never used — 給xxx賦了值但未用過

㈩ 為什麼使用GCC編譯器老是錯誤❌

是你的代碼寫錯了,不是gcc的錯
1.你的main函數要麼只帶2個參數,要麼不帶參數,你寫的是帶1個int參數,把int main(int xxx)的int xxx刪去
2.char string ca[]是什麼玩意??char就是char,string就是string,char string這種東西就跟寫double int,vector map一樣,根本不符合語法。我猜你可能是想寫一個char數組,所以把string去掉即可

熱點內容
銅排折彎最簡單的演算法 發布:2024-04-23 14:48:53 瀏覽:21
我的世界伺服器倒計時清理指令 發布:2024-04-23 14:21:14 瀏覽:465
五班資料庫 發布:2024-04-23 13:59:57 瀏覽:797
在c語言中數字029是一個 發布:2024-04-23 13:52:13 瀏覽:740
我的世界電腦版伺服器怎麼禁足 發布:2024-04-23 13:24:49 瀏覽:547
y壓縮包 發布:2024-04-23 12:41:20 瀏覽:166
內網互相訪問 發布:2024-04-23 12:36:23 瀏覽:319
安卓國際服在哪裡看賬號 發布:2024-04-23 12:30:29 瀏覽:299
android開發伺服器 發布:2024-04-23 12:24:42 瀏覽:237
騰訊雲個人伺服器 發布:2024-04-23 12:24:40 瀏覽:803