喜逢我有这个类与头函数调用未定义参考
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