How to build a static Clucene library to avoid any linker errors

332 views Asked by At

I work with Windovs and I need to build a static CLucene library. I downloaded the latest source code and build them into Visual Studio 2010 Project through CMake-gui 3.4.3. When building I used a flag BUILD_STATIC_LIBRARIES = true. I successfully built two libraries: clucene-core-statics and clucene-shared-static. However, when I run the test project cl-test-static occurs a lot of linker errors. The same thing happens when I add these libraries in another test project.

Error Example:

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: static wchar_t * __cdecl lucene::queryParser::QueryParser::escape(wchar_t const *)" (__imp_?escape@QueryParser@queryParser@lucene@@SAPA_WPB_W@Z) referenced in function "public: void __thiscall Main::Start(void)" (?Start@Main@@QAEXXZ) c:\Users\user\documents\visual studio 2010\Projects\TestClucene\TestClucene\Main.obj TestClucene

Does anyone have any experience in building static CLucene libraries?

0

There are 0 answers