喜逢我有這個類與頭函數調用未定義參考
class WuManber
{
public:
WuManber(void);
virtual ~WuManber(void);
void Initialize(const vector<const char *> &patterns,
bool bCaseSensitive = false, bool bIncludeSpecialCharacters = false, bool bIncludeExtendedAscii = false);
當我嘗試嘗試創建WuManber的實例,並調用初始化我收到以下錯誤:
/tmp/ccx19Os5.o: In function
main': Test.cpp:(.text+0x8d): undefined
WuManber::WuManber()' Test.cpp:(.text+0xbc): undefined
reference to
reference toWuManber::Initialize(std::vector<char const*,
WuManber::~WuManber()'
std::allocator<char const*> > const&, bool, bool, bool)'
Test.cpp:(.text+0xc8): undefined reference to
Test.cpp:(.text+0x115): undefined reference to `WuManber::~WuManber()'
collect2: ld returned 1 exit status
int main(int argc, char* argv[])
{
Parser CustomParserEx;
CustomParserEx.open("/home/abdullah/Project IDS/rules");
WuManber WmAlgorithm;
WmAlgorithm.Initialize(CustomParserEx.patterns,true,true,true);
}
所以任何暗示我做錯了
這些是鏈接器錯誤。你正在編譯和鏈接WuManber類成員函數實現的源文件嗎? – Mahesh 2012-02-26 08:46:26
ooohhhh非常感謝的人我確實不包括源文件WuManber.cpp我怎麼沒有注意到它.....! – user1231229 2012-02-26 08:49:51