作者how0311 (....)
看板Programming
标题[问题] gcc编译问题
时间Thu Feb 28 13:52:39 2008
※ [本文转录自 C_and_CPP 看板]
作者: how0311 (....) 看板: C_and_CPP
标题: [问题] gcc编译问题
时间: Thu Feb 28 10:55:02 2008
今天写了一个test file但是在编译的时候出现错误
不知道有没有高手可以帮忙解决
test file 如下
test.c:
// begine test file
#include<iostream>
using namespace std;
typedef struct tt GTY(()){ // GTY为gcc中控制internal memory的机制
int i;
}tt_t;
int main(){
tt_t t;
return 0;
}
// end test file
执行g++ test.cc後错误讯息如下
test.c: error: typedef `GTY' is initialized (use __typeof__ instead)
test.c: error: expected primary-expression before ')' token
test.c: error: expected `,' or `;' before '{' token
test.c: error: declaration does not declare anything
test.c: In function `int main()':
test.c: error: aggregate `tt_t t' has incomplete type and cannot be defined
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.71.87
1F:推 bokey:去掉 GTY(()) ... 02/28 11:28
2F:→ how0311:如果一定要加GTY(()) 02/28 13:47
3F:→ how0311:这个是gcc中控制internal memory的 02/28 13:47
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.71.87
※ 编辑: how0311 来自: 140.114.71.87 (02/28 13:54)