问题:
d:\greta_vc8\regexpr2.h(893) : error C2079: 'iterator_types_are_not_convertible' uses undefined struct 'regex::detail::static_assert<f>'
        with
        [
            f=false
        ]
        d:\projects\wtl\locator\queryer\dboper.cpp(522) : see reference to function template instantiation 'const regex::backref_tag<IterT> &regex::basic_rpattern<IterT,SyntaxT>::match<wchar_t,std::allocator<_Ty>>(CharT *,regex::basic_match_results<IterT> &) const' being compiled
        with
        [
            IterT=std::_String_const_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,
            SyntaxT=regex::perl_syntax<regex::rechar_t>,
            _Ty=wchar_t,
            CharT=wchar_t
        ]
parser.cpp

看了一下greta源码发现现在Greta的match函数只支持Iterator的了,原本这样就可以:
wchar_t *target = L"123123131312312";
match(target, results);
现在改成:
wchar_t *target = L"123123131312312";
match(wstring(target), results);
这样利用了wstring的方式来做需要拷贝构造函数,好像慢了许多,也许是错觉,
nnd,本来想不在代码里面用stl那个奇烂的string类的:(
对了,restack.h还有两个地方好像要添加一个typename变成:typename stack_node::header才可编译通过

另外,由于这个项目是从VC6.0转过来的,遇到了VS2005 中build的这个问题
CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:2, language:0x0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

Google了一下,找到了答案
http://www.codecomments.com/archive292-2004-11-312117.html

由于项目源文件较多机器又不是超快,incremental build还是需要的,所以我采用的是第一种方法,在工程的.rc文件里面删除了manifest块(有两个地方,其中一个只有一行,另一个有好几行,用BEGIN/END扩起来的,注意删掉它上面的那个一行TEXTINCLUDE,否则VS2005会解析错误而打不开资源文件)

另外还有几个warning暂时不管了:
warning C4996: 'wcstok' was declared deprecated
warning C4005: 'ARRAYSIZE' : macro redefinition
c:\program files\microsoft visual studio 8\vc\include\xutility(2841) : warning C4996: 'std::_Fill_n' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\xutility(2282) : warning C4996: 'std::_Copy_opt' was declared deprecated

这个4996警告是说方法过期,都是regexpr2.cpp中用的,不管了,我这个工程用不了这么久,直接 #pragma warning(disable:4996) 了事。

posted on 2005-11-20 21:17  尉迟方  阅读(5884)  评论(2编辑  收藏  举报