how to use lemur in eclipse whith C++

  • tian chengbo

    tian chengbo - 2011-07-19

    hello,I want to use lemur in C++,however,when I follow this instruction :

    I got some errors as following:

    /usr/local/lib/liblemur.a(main.o): In function `main':
    /home/boge/software/experiment/lemur-4.12/utility/obj/../src/main.cpp:38: undefined reference to `GetAppParam()'
    /home/boge/software/experiment/lemur-4.12/utility/obj/../src/main.cpp:42: undefined reference to `AppMain(int, char**)'
    /home/boge/software/experiment/lemur-4.12/utility/obj/../src/main.cpp:33: undefined reference to `GetAppParam()'
    collect2: ld returned 1 exit status
    make: *** [lemur] 错误 1

    In my,the parameters are:
    OBJS = /usr/local/lib/liblemur.a
    PROG = lemur

    and my structure of the progect is:

    How can I fix it,can anybody give me some suggestions,thank you!
    mentions: I have install the lemur correctly,and I can use lemur in java with

  • tian chengbo

    tian chengbo - 2011-07-19

    Here is the

    #include "Index.hpp"
    #include "IndexManager.hpp"
    #include <string>
    using namespace lemur::api;
    using namespace std;
    int main(int argc, char *argv[]) {
        string indexPath="/home/boge/workspace1/IDF_casedbased/indexs/ct/p";
        Index *theIndex=IndexManager::openIndex(indexPath);
        int numDocuments=theIndex->docCount();
        float avgDocLength=theIndex->docLengthAvg();
        int totalTermCount=theIndex->termCount();
        int uniqueTermCount=theIndex->termCountUnique();
        cout << "# documents: " << numDocuments << endl;
        cout << "Avg. Document Length: " << avgDocLength << endl;
        cout << "# terms: " << totalTermCount << endl;
        cout << "# unique terms: " << uniqueTermCount << endl;
        delete theIndex;
  • tian chengbo

    tian chengbo - 2011-07-19

    I have fix this problem,
    OBJS = /usr/local/lib/liblemur.a
    should be like this:
    OBJS = /home/boge/workspace-indri/lemur/src/

    But I have another problem, I want build my project in eclipse, so how to
    configure my environment.
    I have a try just like how to configure "Boost" library in eclipse:

    in eclipse's c++project ,I only set the “liblemur.a“:
    c/c+ Build >> settings >> cross G++ linker >> Miscellaneous >> other objects >> /usr/local/lib/liblemur.a

    But this can't work, how can I fix this one,thank you!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks