我从微软的站点下载了greta模版库,然后直接在程序中引用,并将greta的几个文件COPY到该项目的目录下。#include "stdafx.h"
#include <iostream>
#include <string>
#include "regexpr2.h"using namespace std;
using namespace regex;int _tmain(int argc, _TCHAR* argv[])
{
    match_results results;
    string str( "The book cost $12.34" );
    rpattern pat( "\\$(\\d+)(\\.(\\d\\d))?" );      // Match a dollar sign followed by one or more digits,
    // optionally followed by a period and two more digits.
    // The double-escapes are necessary to satisfy the compiler.    match_results::backref_type br = pat.match( str, results );    if( br.matched )
{
        cout << "match success!" << endl;
        cout << "price: " << br << endl;
    }
else
{
        cout << "match failed!" << endl;
    }
return 0;
}然后编译,提示下列错误。textrx error LNK2019: 无法解析的外部符号 "protected: bool __thiscall regex::detail::basic_rpattern_base_impl<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator>::_ok_to_recurse(void)const " (?_ok_to_recurse@?$basic_rpattern_base_impl@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@detail@regex@@IBE_NXZ) ,该符号在函数 "public: static bool __cdecl regex::detail::matcher_helper<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator>::_do_try_match<class std::allocator<class regex::backref_tag<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator> > >(class regex::detail::basic_rpattern_base_impl<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator> const &,struct regex::detail::match_param<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator> &,class std::vector<class regex::backref_tag<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator>,class std::allocator<class regex::backref_tag<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator> > > &,bool)" (??$_do_try_match@V?$allocator@V?$backref_tag@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@regex@@@std@@@?$matcher_helper@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@12@AAU?$match_param@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@12@AAV?$vector@V?$backref_tag@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@regex@@V?$allocator@V?$backref_tag@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@regex@@@std@@@s请问这是什么问题,需要把greta编译成LIB文件吗?如何编译?