最近要在win下使用pcre,所以要在Windows下编译pcre。 下面是步骤和遇到的问题,及其解决办法:
平台是: win7 + vs2008, 源码:pcre8.32
步骤主要参考的是:
http://zhidao.baidu.com/question/401968099.html
问题集锦:
问题1:
Cannot open include file: 'stdint.h': No such file or directory
解决办法: 把含有 stdint.h那行注释掉。
问题2:
error LNK2005: _main already defined in dftables.obj
有两个文件中含有main函数。 所以用win7在工程下,查找关键字main。 结果找到了。 把那个文件从工程中remove出去。
再编译,没有报这个错误了。
错误3:
error LNK2005: _pcre_maketables already defined in dftables.obj
这个很苦逼啊。 居然在dftables.c里面有
//#define DFTABLES /* pcre_maketables.c notices this */
//#include "pcre_maketables.c"这两行。 我把它注释掉之后,就buid通过了。 但是使用的情况还得继续测试。
本文记录了在Win7+VS2008环境下编译pcre8.32的过程,包括解决编译过程中遇到的如找不到'stdint.h'文件、重复定义_main及_pcre_maketables等问题的方法。
969

被折叠的 条评论
为什么被折叠?



