首页 > 其他分享 >greta 编译,配置,使用

greta 编译,配置,使用

时间:2023-06-09 17:05:02浏览次数:31  
标签:std regex const greta 配置 编译 WU class allocator


正则表达式 regular expression greta vc6 compile 2008 2010
1. greta 在 vc6下能顺利编译
greta 2.64. (最后的版本已不存在vc6和vc6之外的区别了,作者最后合并到一起了)

2. 使用 vs2008 (visual studio 2008) 编译会出现以下这些错误:
2.1 具体错误
error C2923: 'regex::hetero_stack<AlignmentT,RuntimeTypeCheckT,AssumePodT,DynamicBlockSizeT,StaticBlockSizeT>::aligned_sizeof' : 'regex::hetero_stack<AlignmentT,RuntimeTypeCheckT,AssumePodT,DynamicBlockSizeT,StaticBlockSizeT>::stack_node::header' is not a valid template type argument for parameter 'T' restack.h    355

//z 2012-1-17 3:09 PM IS2120
2.2 解决方案
byte_t      m_buf[ aligned_sizeof<stack_node::header>::no_rtti + StaticBlockSizeT ];
-->
在 stack_node::header 前面添加上 typename 即可

2.3 去除其他的警告

在" 
Project Properties -> Configuration Properties -> C\C++ -> Preprocessor -> Preprocessor Definitions"中添加宏" 
_SCL_SECURE_NO_WARNINGS" 

 
_CRT_SECURE_NO_DEPRECATE



3. 使用 visual studio 2010 编译
会遇上编译错误,主要原因是

template< bool f > struct static_assert; 

 template<>         struct static_assert<true> { static_assert() {} };



主要是因为 static_assert 在 visual studio 2010 已经是一个保留关键字了。。。

1>restack.h(56): error C2332: 'struct' : missing tag name
 1>restack.h(56): error C3306: 'regex::detail::<unnamed-tag>': unnamed class template is not allowed
 1>restack.h(56): error C2143: syntax error : missing ';' before 'static_assert'
 1>restack.h(56): error C2059: syntax error : ';'
 1>restack.h(57): error C2332: 'struct' : missing tag name
 1>restack.h(57): error C2143: syntax error : missing ';' before 'static_assert'
 1>restack.h(57): error C2913: explicit specialization; 'regex::detail::<unnamed-tag>' is not a specialization of a class template
 1>restack.h(57): error C2059: syntax error : '<'
 1>restack.h(57): error C2143: syntax error : missing ';' before '{'
 1>restack.h(57): error C2447: '{' : missing function header (old-style formal list?)



3.1 解决了这个问题之后,发现出出现linked error
暂无法解决(已解决,详见3.2)

: error LNK2019: unresolved external symbol "protected: void __thiscall regex::basic_rpattern_base<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class regex::perl_syntax<wchar_t> >::_common_init(enum regex::REGEX_FLAGS)" (?_common_init@?$basic_rpattern_base@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$perl_syntax@_W@regex@@@regex@@IAEXW4REGEX_FLAGS@2@@Z) referenced in function "protected: __thiscall regex::basic_rpattern_base<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class regex::perl_syntax<wchar_t> >::basic_rpattern_base<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class regex::perl_syntax<wchar_t> >(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,enum regex::REGEX_FLAGS,enum regex::REGEX_MODE)" (??0?$basic_rpattern_base@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$perl_syntax@_W@regex@@@regex@@IAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@W4REGEX_FLAGS@1@W4REGEX_MODE@1@@Z)
  : error LNK2019: unresolved external symbol "unsigned int __cdecl regex::detail::DEFAULT_BLOCK_SIZE(void)" (?DEFAULT_BLOCK_SIZE@detail@regex@@YAIXZ) referenced in function "protected: __thiscall regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >(enum regex::REGEX_FLAGS,enum regex::REGEX_MODE,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (??0?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@IAE@W4REGEX_FLAGS@2@W4REGEX_MODE@2@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2@Z)
  : error LNK2019: unresolved external symbol "public: static bool __cdecl regex::detail::regex_access<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_do_match_with_stack(class regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >> const &,struct regex::detail::match_param<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > &,bool)" (?_do_match_with_stack@?$regex_access@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@23@AAU?$match_param@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@23@_N@Z) referenced in function "public: static bool __cdecl regex::detail::regex_access<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_do_try_match<class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > >(class regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > const &,struct regex::detail::match_param<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > &,class std::vector<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > > &,bool)" (??$_do_try_match@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@?$regex_access@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAU?$match_param@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAV?$vector@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@std@@_N@Z)
  : error LNK2019: unresolved external symbol "public: static bool __cdecl regex::detail::regex_access<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_do_match_impl(class regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > const &,struct regex::detail::match_param<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > &,bool)" (?_do_match_impl@?$regex_access@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@23@AAU?$match_param@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@23@_N@Z) referenced in function "public: static bool __cdecl regex::detail::regex_access<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_do_try_match<class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > >(class regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > const &,struct regex::detail::match_param<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > &,class std::vector<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > > &,bool)" (??$_do_try_match@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@?$regex_access@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAU?$match_param@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAV?$vector@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@std@@_N@Z)
  : error LNK2019: unresolved external symbol "protected: bool __thiscall regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_ok_to_recurse(void)const " (?_ok_to_recurse@?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@IBE_NXZ) referenced in function "public: static bool __cdecl regex::detail::regex_access<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >::_do_try_match<class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > >(class regex::detail::basic_rpattern_base_impl<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > const &,struct regex::detail::match_param<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > &,class std::vector<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<class regex::backref_tag<class std::_String_const_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > > &,bool)" (??$_do_try_match@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@?$regex_access@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@detail@regex@@SA_NABV?$basic_rpattern_base_impl@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAU?$match_param@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@12@AAV?$vector@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@V?$allocator@V?$backref_tag@V?$_String_const_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@regex@@@std@@@std@@_N@Z)


3.2 解决编译错误
//z 2012-1-18 10:46 AM IS2120
今天研究了下这个链接错误,将 greta.lib 加入搜索路径就可以了。(为啥vc6以及vs2008都能正确处理project dependency而vs2010不能了?)
(adding "greta.lib" to lib's searching path can resolve this issue)

3.3 其他:输出详细的编译链接信息,这样有利于错误的排除
生成的lib文件也可以输出到相应的会被用到的地方。

标签:std,regex,const,greta,配置,编译,WU,class,allocator
From: https://blog.51cto.com/u_16156420/6449422

相关文章

  • vnc 配置 已验证
    配置错误,但是能用[root@rac1sbin]#systemctlstatusvncserver@:2.service-lvncserver@:2.service-Remotedesktopservice(VNC)  Loaded:loaded(/usr/lib/systemd/system/vncserver@:2.service;disabled)  Active:failed(Result:exit-code)sinceSun2015-05-......
  • VC6.0编译器参数设置
    VC6.0编译器参数的设置主要通过VC的菜单项Project->Settings->C/C++页来完成。我们可以看到这一页的最下面ProjectOptions中的内容,一般如下:/nologo/MDd/W3/Gm/GX/ZI/Od/D"WIN32"/D"_DEBUG"/D"_WINDOWS"/D"_AFXDLL"/D"_MBCS"/Fp"Debug......
  • notepad++ c# ide 配置
    tag:notepad++c#IDE编译环境搭配 配置C#运行notpad++,点击“运行-》运行”菜单,出现一个弹出框,输入命令行,而后保存即可。1.编译cmd/kC:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe/out:"$(CURRENT_DIRECTORY)\$(NAME_PART).exe""$(FULL_CURRENT_PATH)"&......
  • Linux环境下配置.Net自动部署
    使用VMWorkStation安装虚拟机下载VMWorkStation安装包安装包是通过关注“柠檬工会”公众号下载的,里面资源很多。参考教程安装虚拟机安装教程地址:https://blog.csdn.net/Liqi23/article/details/126622330我忘记了root密码,所以又去找教程重置密码教程地址:https://www.jb5......
  • Linux系统之Nginx的编译安装
    (Linux系统之Nginx的编译安装)一、检查系统版本[root@server001~]#cat/etc/os-releaseNAME="CentOSLinux"VERSION="7(Core)"ID="centos"ID_LIKE="rhelfedora"VERSION_ID="7"PRETTY_NAME="CentOSLinux7(Core)"......
  • Vue 调试访问本地后端接口配置
    记录一下本地测试前端的时候怎么访问本地后端接口。时间太长容易忘。。。。1、首先要知道前端在访问后端的时候是怎么加上后端接口地址的。如下图,找到封装http请求的文件,src/utils/rerquest.js该图中的baseURL就是访问时我们加上的后端请求地址。baseURL:process.env.VUE_APP......
  • [Java SE] 彻底搞懂Java程序的三大参数配置途径:系统变量与JVM参数(VM Option)/环境变
    0序言一次没搞懂,处处受影响。这个问题属于基础问题,但又经常踩坑,不得不重视一下了。1Java程序动态参数的配置途径:系统变量与JVM参数(VMOption)vs环境变量vs启动程序参数argsIDEA中的配置位置参数使用方式示例代码获取方式系统属性由操作系统、JVM、应用......
  • Golang 配置代理
    通过 goget 命令下载各种依赖时,经常需要访问github/google等网站。配置好代理后,可以快速稳定的访问。常用的go代理goproxyhttps://goproxy.io/zh/阿里云https://mirrors.aliyun.com/goproxy/七牛云https://goproxy.cn设置go代理go1.13及以上版本可以直接用下面......
  • Memcache升级版:CouchBase的安装配置与使用说明
    Memcache基本上已经是开发的标配了,但是对于Memcache集群,很多线上部署仍然是很单薄的。几个存在的问题:不健壮、数据不安全、配置变更可能导致存取异常、后备数据的一致性鉴于存在以上问题,Memcache的开发团队开发了Membase,支持多台服务器集群,数据的切片和复制,有效的提高了服务稳定性......
  • 小程序后端服务上线如何配置
    https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html  两种模式:一:无端口(即默认端口443,但是请求时不能带端口)二:有端口(即便是默认443,也要带着)......