clucene mac os 10.9编译会报错的解决办法

在Mac OS 10.9上编译clucene时,可能会遇到两个错误:一是缺少,二是_tcsstr函数存在二异性。解决方案包括添加pthread.h头文件,以及用标准库函数替换_tcsstr等函数,例如使用std::wcsstr等。
摘要由CSDN通过智能技术生成

如果直接编译的话,第一个错误的原因是没有写<pthread.h>

第二个错误是_tcsstr会有二异性,修改方法如下:

/*------------------------------------------------------------------------------

* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team

*

* Distributable under the terms of either the Apache License (Version 2.0) or

* the GNU Lesser General Public License, as specified in the COPYING file.

------------------------------------------------------------------------------*/

#ifndef _REPL_TCHAR_H

#define _REPL_TCHAR_H


#ifndef _CL_HAVE_TCHAR_H

    #if defined(_UCS2)


        //note: descriptions with * in front have replacement functions


        //formatting functions

        #define _sntprintf swprintf //* make a formatted a string

        #define _tprintf wprintf //* print a formatted string


        //this one has no replacement functions yet, but it is only used in the tests

        #define _vsntprintf vsnwprintf //* print a formatted string using variable arguments


        //we are using the internal functions of the compiler here

        //if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse

        //will be replaced by internal functions

        #define _istalnum iswalnum //* alpha/numeric char check

        #define _istalpha iswalpha //* alpha char check

        #define _istspace iswspace //* space char check

        #define _istdigit iswdigit //* digit char check

        #define _totlower towlower //* convert char to lower case

        #define _totupper towupper //* convert char to lower case

        #define _tcslwr std:wcslwr //* convert string to lower case


        //these are the string handling functions

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值