[bt-devel] Sword 1.6 for FreeBSD

Gabriel M. Beddingfield gabriel at teuton.org
Tue Sep 26 21:18:27 MST 2006


Hi Thomas,

Thomas Abthorpe wrote:
> 
> cswordmoduleinfo.cpp:401: error: cannot convert `const char*' to `const 
> wchar_t*' for argument `2' to `size_t lucene_wcstoutf8(char*, const 
> wchar_t*, size_t)'
> 
> More information is availible at 
> http://www.goodking.ca/tb/errors/5.5-FreeBSD/bibletime-1.6.log

LONG STORY SHORT:

The Makefile in ports configures using '--enable-ascii', which defeats 
UNICODE support in CLucene.  However, BibleTime is expecting a UNICODE 
CLucene.  If possible, CLucene should be configured without using 
--enable-ascii.  The BT should consider testing for this, or handling an 
'ASCII' CLucene (see below).

LOOONG STORY:

Tracing backwards... (a.k.a. thinking out loud...)

CLucene's Document::get() returns const TCHAR*
CLucene's lucene_wcstoutf8() looks for const wchar_t*

CLucene defines TCHAR to be either wchar_t or char, depending on the how 
CLucene was built.  (CLucene looks for _UCS2 to be defined.)  This gets 
determined at the ./configure step from CLucene.  (UCS == "Unicode 
Character Set")

1. See /usr/local/include/CLucene/config/repl_tchar.h:8
    where TCHAR is defined to either be wchar_t or char.

2. See CLucene sources where configure.ac:36 has some
    configuration flags, including _ASCII and _UCS2
    (char and wchar_t, respectively).

3. See CLucene src/CLucene/clucene-config.h.cmake -->
    src/CLucene/clucene-config.h -->
    /usr/local/include/CLucene/clucene-config.h
    I'll bet you find a line with #define _ASCII.

4. AFAIK, you make CLucene do this, you have to specifically
    do './configure --enable-ascii'.  This defeats unicode
    and uses ASCII instead.

So, my guess is that you need to reconfigure/rebuild CLucene for 
unicode, without the '--enable-ascii' in the ./configure flags.

Looking at the FreeBSD Ports Makefile for CLucene, this is the case on 
line 19:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/textproc/clucene/Makefile?rev=1.1&content-type=text/x-cvsweb-markup

CONFIGURE_ARGS+=	--enable-ascii

There are 8 places in BT (all in cswordmoduleinfo.cpp) that refer to 
some CLucene hard-coded data type functions (like lucene_wcstoutf8()). 
Perhaps these should be modified to handle the case where TCHAR is 
defined to be char instead of wchar_t.  Otherwise, perhaps there should 
be a check for this in the ./configure step for BibleTime.  (e.g. 
scanning the clucene_config.h file for '#define _ASCII'.)

Peace,
Gabriel




More information about the bt-devel mailing list