안녕하세요 모두 내가 가진 그 헤더를 사용해,이 클래스함수 호출 정의되지 않은 참조
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
우물쭈물하다. 나는 정말로 어떻게 소스 파일 WuManber.cpp를 포함하지 않았는가? – user1231229