I have a question about some problem that I have with g++.
I have a very simple application that is edited by Eclipse with c++ language in ubuntu operating system.
I want to use the classes of CLucene libraries.
But In spite of including header files and namesapces I get this error "undefined reference to `lucene::analysis::standard::StandardAnalyzer::StandardAnalyzer()"
Here is my simple application code:
#include <stdio.h>
#include </usr/include/CLucene/config/define_std.h>
#include </usr/include/CLucene/config/repl_wchar.h>
#define TCHAR wchar_t //it is necessary to be here
I really don't have any idea about the problem that it may have. I tried different format of creating instance of classes but i get the same error in all cases.
which is the constructor for the StandardAnalyser class.
You are forward declaring the class but not defining it which doesn't really make sense. If it is defined in the header files then you don't need to forward declare it. If it is a class the you are creating then just forward declaring it is not enough. You need to define the class. You seem to have straddled the fence.
is the forward declaration. It just tells the compiler that the class exists, it doesn't tell the compiler anything about it. The compiler needs a class definition.
So, is it a class that is defined in the CLucene libraries or is it a class you are creating yourself? Your solution depends on your answer.
I wanted to link the libclucene.so to the project as you recommended but
Unfortunately, When i add this library in list of libraries and add the path of it (/usr/lib) in eclipse it returns :