luceneplusplus / LucenePlusPlus

Lucene++ is an up to date C++ port of the popular Java Lucene library, a high-performance, full-featured text search engine.
luceneplusplus@googlegroups.com
Other
738 stars 233 forks source link

undefined reference to `Lucene::Document::Document()' #114

Open ShangHong-CAI opened 5 years ago

ShangHong-CAI commented 5 years ago

I want to add Demo function to my project,but I only add DocumentPtr doc = newLucene<Document>(); to my code,and I have error.

g++ -std=c++11  -I/usr/local/include/ -I/usr/local/include/lucene++ main.1.cpp -o test.out -lboost_system -L/usr/local/lib/
/tmp/ccFsKMbz.o: In function `boost::detail::sp_if_not_array<Lucene::Document>::type boost::make_shared<Lucene::Document>()':
main.1.cpp:(.text._ZN5boost11make_sharedIN6Lucene8DocumentEJEEENS_6detail15sp_if_not_arrayIT_E4typeEDpOT0_[_ZN5boost11make_sharedIN6Lucene8DocumentEJEEENS_6detail15sp_if_not_arrayIT_E4typeEDpOT0_]+0x77): undefined reference to `Lucene::Document::Document()'
collect2: error: ld returned 1 exit status
makefile:6: recipe for target 'test' failed
make: *** [test] Error 1

Can someone tell me what happen to this error?