我正在尝试在Mac上运行SystemC程序,一些基本程序正在编译并运行良好。
但是我收到以下错误:
Undefined symbols for architecture x86_64:
"PktTrans::PktTrans()", referenced from:
producer::processGen() in producer-110ef6.o
ld: symbol(s) not found for architecture x86_64
功能:
void producer::processGen()
{
int x;
x = rand() % 50 + 1;
cout<<clk<<":gen random x="<<x<<endl;
PktTrans* intrans=new PktTrans;
intrans->setAddr(rand() %50 +1);
intrans->setId(transid);
intrans->setOpc(1);
incoming.push_back(intrans);
transid++;
}
PktTrans::PktTrans()
{
id = -1;
addr = 0;
opc=0;
}
我刚刚添加了SystemC头文件,并将int main()
更改为int sc_main()
。没有SystemC,程序编译和运行正常。关于为什么会出现这些错误的任何想法?