作者waytin (waytin)
看板EE_DSnP
标题[问题] expected unqualified-id ???
时间Wed Jun 4 18:35:49 2008
我的程式码如下
int
aigToCir (const char *fileName)
{
int res = 0;
// TODO...
// Interface to AIG reader!!
extern "C"
{
res = aigtocir(fileName);
f();
}
g();
return res;
}
compile时候
cirInterface.cpp:24: 错误:expected unqualified-id before string constant
cirInterface.cpp:29: 错误:「g」 在此作用栏位中尚未宣告
其中24行是extern "C"那行
29行则是g()那行
f跟g是我随便打的,根本没implement
aigtocir是aig package中的函数。
总之,到extern "C"那行就爆了,
到底为什麽呢?
先谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.251.184
1F:推 old000:因为 extern "C" 用法不太对 06/04 18:59
2F:→ old000:试试看把 extern "C" {...} 移到档案的开头 06/04 19:00
3F:推 old000:{...} 里面是 struct aiger 之类的东西 06/04 19:02
4F:→ old000:btw, {...} 里面应该都是宣告或定义 06/04 19:04
5F:→ old000:像是 int aigtocir(char*); 06/04 19:05
6F:→ waytin:感谢,我了解了 06/04 20:10