[sword-devel] compiling sword library with CLucene

Greg Hellings greg.hellings at gmail.com
Sat Mar 7 21:48:20 MST 2009


MMital,

I had the same problem linking CLucene into Bibletime.  The solution
was simple, although not self-evident.  I'm going to guess that you
are building the CLucene library with the provided project file in
clucene-core-0.9.21b\win32.  This is, strangely, not an overly
effective way to do it.  Download and install CMake for Windows from
the CMake website and run it, telling it to configure in the CLucene
directory.  Then open the file in src\CLucene\clucene-core.vcproj and
build with that.  The target build of the library will be
src\CLucene\debug\clucene-core.lib and
src\CLucene\release\clucene-core.lib.  Then point the SWORD sources to
include files from src\ and it should pickup the proper configuration
files src\CLucene\clucene-config.h (a file which is created by CMake
from the clucene-config.h.cmake file and is actually in-touch with the
settings of the built library).  Obviously you'll need to add the
LUCENE_AVAILABLE or whatever pre-processor macro to the SWORD project
and also add the include directories and point the proper version of
the clucene-core.lib library.  We were missing most of the same issues
with deprecated versions of the functions in BibleTime and it wasn't
until I realized that the VC Project files that were included in win32
had some misconfiguration problems that the CMake-generated VC Project
files had correct that I was able to overcome most of those problems.

It should also prevent you from having to manually #define TCHAR, but
I don't know that for sure.  Happy hacking!

--Greg

On Sat, Mar 7, 2009 at 10:22 PM, mmital2 <mital.manu at gmail.com> wrote:
>
> Hi,
>
> Made a little progress with this. A majority of the 133 errors related to
> TCHAR disappeared after I added:
>
> #define TCHAR char
>
> I added this in StdHeader.h line 177
>
> //always include replacement, some missing tchar defines
> #include "CLucene/config/repl_tchar.h"
> #define TCHAR char                              // <---- added (I am doing
> non-unicode builds)
>
>
> Now, I am only left with a few linker warnings when compiling CLucene.lib,
> and only 7 errors when compiling libsword.lib
>
> When compiling CLucene.lib, I get these warnings:
>
> 1>condition.obj : warning LNK4221: no public symbols found; archive member
> will be inaccessible
> 1>threads.obj : warning LNK4221: no public symbols found; archive member
> will be inaccessible
> 1>gunichartables.obj : warning LNK4221: no public symbols found; archive
> member will be inaccessible
> 1>MMapInput.obj : warning LNK4221: no public symbols found; archive member
> will be inaccessible
>
> When compiling the non-unicode sword static library with CLucene support
> enabled, the errors are in swmodule.cpp
>
> error C2665: 'lucene::queryParser::QueryParser::parse' : none of the 3
> overloads could convert all the argument types  swmodule.cpp    513
> error C2664: 'lucene_wcstoutf8' : cannot convert parameter 2 from 'const
> char *' to 'const wchar_t *'    swmodule.cpp    524
> error C2665: 'lucene::document::Field::Text' : none of the 2 overloads could
> convert all the argument types  swmodule.cpp    1109
> error C2664: 'lucene::document::Field::UnStored' : cannot convert parameter
> 2 from 'wchar_t [2048]' to 'const char *'       swmodule.cpp    1120
> error C2664: 'lucene::document::Field::UnStored' : cannot convert parameter
> 2 from 'wchar_t [2048]' to 'const char *'       swmodule.cpp    1124
> error C2664: 'lucene::document::Field::UnStored' : cannot convert parameter
> 2 from 'wchar_t [2048]' to 'const char *'       swmodule.cpp    1245
> error C2664: 'lucene::document::Field::UnStored' : cannot convert parameter
> 2 from 'wchar_t [2048]' to 'const char *'       swmodule.cpp    1250
>
> Thanks for help,
> mmital
> http://www.swordwarrior.net
>
>
>
>
>
>
>
> David Trotz wrote:
>>
>> I wish I could help, but I have not done much with clucene. What I can say
>> is if you get it to work, can you tell me how you did it? I want to build
>> clucene for wince and I am guessing you will have me half way there once
>> you
>> get it worked out yourself :-P
>> In Christ,
>> David Trotz
>>
>>
>> On 2/2/09 11:05 AM, "mmital" <mital.manu at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Can someone help me figure out how to compile sword with CLucene support?
>>>
>>> Here are the errors I'm getting.....
>>>
>>> http://www.swordwarrior.net/CLucene_MSVS.pdf
>>>
>>> Thanks a lot,
>>> mmital
>>>
>>>
>>>
>>> _______________________________________________
>>> sword-devel mailing list: sword-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/sword-devel
>>> Instructions to unsubscribe/change your settings at above page
>>
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
>
> --
> View this message in context: http://www.nabble.com/compiling-sword-library-with-CLucene-tp21796124p22394850.html
> Sent from the SWORD Dev mailing list archive at Nabble.com.
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>



More information about the sword-devel mailing list