[问题][未解决] cirp -fl [已解决]undefined reference

楼主: XDucka (Duck)   2012-12-17 14:50:28
请问一下为什么我在
class CirGate
{
public:
CirGate(unsigned g):_ref(_gRef),_gateId(g){}
virtual ~CirGate() {}
...
static unsigned _gRef;
static void gpp(){++_gRef;}
private:
protected:
unsigned _ref;
...
};
class AigGate : public CirGate{
public:
AigGate(unsigned g):CirGate(g),_fanout(0){
_ref=_gRef; ...}
private:
...
};
compile的时候一直出现呢 Q_Q
/home/sillyduck/Ubuntu One/DSnP/hw6/src/cir/cirGate.h:27: undefined reference
to `CirGate::_gRef'
../../lib/libcir.a(cirMgr.o): In function `AigGate':
/home/sillyduck/Ubuntu One/DSnP/hw6/src/cir/cirGate.h:59: undefined reference
to `CirGate::_gRef'
我把code全部复制到新的123.cpp再compile就可以过 =.=|||
顺便问一下 cirp -fl 的顺序不太一样这OK吗
ref的顺序是用dfs的顺序还是照大小排序的顺序阿?
作者: ypf791 (路人1号)   2012-02-17 15:38:00
检查一下cirMgr.cpp有没有#include "CirGate.h"抱歉 是cirMgr.h可能没有#include "CirGate.h"另外 我觉的_gRef可以定成protected....
楼主: XDucka (Duck)   2012-02-17 15:46:00
有 Orz

Links booklink

Contact Us: admin [ a t ] ucptt.com