[問題][未解決] 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