linux gcc編譯錯誤

2021-09-08 02:43:07 字數 504 閱讀 1235

linux gcc編譯錯誤

2023年09月12日

⁄ c/c++, 作業系統 

linux系統下的c程式設計與windows有所不同,如果你在用gcc編譯**的時候提示『for』 loop initial declarations are only allowed in c99 mode,可能就是因為你在loop迴圈比如for中使用未預先定義的變數,比如:

for(int i=0;i<10;i++)

這種寫法在vc裡是沒有錯的,而子gcc就會提示錯誤,要求遵守c89標準,c89標準是不支援上述寫法的。如果你非要這麼寫可以這樣編譯,使用c99標準:

gcc helo.c -std=c99 -o hello 

當然,你也可以先定義i變數。

int i;

for(i=0;i<10;i++)

這樣再編譯就不會再提示『for』 loop initial declarations are only allowed in c99 mode這樣的錯誤了

mk編譯錯誤

要在工程 中加乙個巨集去控制 在config.mk中定義這個巨集 enable it6263 1 在compile option.mk中根據這個值來定義巨集 ifeq enable it6263 1 cc opts denable it6263 1 else cc opts denable it62...

Greta 編譯錯誤

背景 greta2.6.4在vs2008編譯通過,在vs2013中,編譯出現以下錯誤 1 regexpr2.cpp 1 c users administrator desktop greta greta restack.h 56 error c2332 struct 缺少標記名 1 c users ...

c 編譯錯誤

一.變數未定義的引用 1.如果變數是類中的靜態成員,需要先在類外部初始化。否則會出現此種錯誤 二。標頭檔案包含了,卻報 zsp ipc proxy client.hh 8 1 錯誤 expected class name before endif 注意不能包含這些函式所在庫的標頭檔案。比如info ...