Fóruns: Ajuda (Thread #19628)

I got some problem with compiling in linux (2008-08-18 23:14 by kiko555 #38306)

I had installed the darts-0.32 before make chasen 2.4.0

But I got the error message :
------------------------------
dartsdic.cpp: In function `int da_build_dump(da_build_t*, char*, FILE*)':
dartsdic.cpp:199: error: invalid conversion from `char**' to `const char**'
dartsdic.cpp:199: error: initializing argument 2 of `int
Darts::DoubleArrayImpl<node_type_, node_u_type_, array_type_, array_u_type_,
length_func_>::build(unsigned int, const node_type_**, const size_t*, const
array_type_*, int (*)(unsigned int, unsigned int)) [with node_type_ = char,
node_u_type_ = unsigned char, array_type_ = long int, array_u_type_ = long
unsigned int, length_func_ = Darts::Length<char>]'
make[2]: *** [dartsdic.lo] Error 1
make[2]: Leaving directory `/home/kiko/master/chasen/chasen-2.4.0/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kiko/master/chasen/chasen-2.4.0'
make: *** [all] Error 2
----------------------------

Anyone know how to solve?

RE: I got some problem with compiling in linux (2008-09-08 22:45 by sapporo_geek #38758)

I am messing about with chasen 2.3.3 and darts 0.32 per ソースからインストール page on the Chasen Wiki (http://chasen.naist.jp/hiki/ChaSen/?%A5%BD%A1%BC%A5%B9%A4%AB%A4%E9%A4%CE%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB).

I ran into similar problems, and looking at the above error message, I think I can point you in the right direction.

I found a write-up on this issue in several places, you might want to look here: http://quruli.ivory.ne.jp/diary/?date=20080423. You need to make the following three edits:

In essence, before configuring chasen to use darts, you need to edit lib/dartsdic.cpp in your install directory for chasen.

1. Near line 71: change function call "setArray" to "set_array"
darts->setArray(cha_mmap_map(da->da_mmap)); <= 変更前

darts->set_array(cha_mmap_map(da->da_mmap)); <= 変更後

2. Near line 164: use const char** and const char*
char** keys = new char*[entries->size()]; <= 変更前

const char** keys = new const char*[entries->size()]; <= 変更後


3. Near 181: in relation to the edit 2. above,
change the pointer casts.
(const char*)keys[size] = key.data(); <= 変更前

keys[size] = (char*)key.data(); <= 変更後

Upon making these edits, run configure and do the normal make && make install dance. You should be good to go.

Aloha!
//Brooke
Responder a #38306