最近要在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通过了。 但是使用的情况还得继续测试。