问题描述
我下载了 MinGW的,附带升压(GCC 4.6.1的分布和Boost 1.47 .0)。我想在C ++程序使用正则表达式加速包。 libboost_regex.a包含在C:\\ dev的\\ MinGW的\\ lib中,这是在我的道路以及为MinGW的库搜索路径。当我编译,它给了我很多很多的错误。我试图给它在G ++命令行库的确切路径,但无济于事。在编译我的最好的尝试: G ++ -o测试-LC:\\ dev的\\ MinGW的-lboost_regex testBoost.cpp
。节目我试图运行:
的#include<&iostream的GT;
#包括LT&;升压/ regex.hpp>INT主(INT ARGC,CHAR *的argv [])
{
静态常量的boost ::正则表达式EXP(你好正则表达式!);
}
我的堆积如山的一堆错误的:
<$p$p><$c$c>C:\\Users\ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail27cpp_regex_traits_char_layerIcEC2ERKNS0_21cpp_regex_traits_baseIcEE[boost::re_detail::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail::cpp_regex_traits_base<char>常量和放大器;)] + 0x20的):未定义的引用`提振:: re_detail :: cpp_regex_traits_char_layer&LT;焦炭&GT; ::的init()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail11raw_storage6extendEj[boost::re_detail::raw_storage::extend(unsigned INT)] + 0×41):未定义的引用`的boost :: re_detail :: raw_storage ::调整(无符号整数)'
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; ::失败(升压:: regex_constants :: ERROR_TYPE,INT的std :: basic_string的&LT;焦炭,的std :: char_traits&LT;焦炭&gt;中的std ::分配器&LT;焦炭&GT;&gt;中INT)] + 0x214):未定义的引用为`的boost :: regex_error :: regex_error(标准::字符串常量和放大器;,提振:: regex_constants :: ERROR_TYPE,INT)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; ::失败(升压:: regex_constants :: ERROR_TYPE,INT的std :: basic_string的&LT;焦炭,的std :: char_traits&LT;焦炭&gt;中的std ::分配器&LT;焦炭&GT;&gt;中INT)] + 0x21f):未定义的引用为`提振:: regex_error ::加薪()const的
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; ::失败(升压:: regex_constants :: ERROR_TYPE,INT的std :: basic_string的&LT;焦炭,的std :: char_traits&LT;焦炭&gt;中的std ::分配器&LT;焦炭&GT;&gt;中INT)] + 0x22a):未定义的引用为`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; ::失败(升压:: regex_constants :: ERROR_TYPE,INT的std :: basic_string的&LT;焦炭,的std :: char_traits&LT;焦炭&gt;中的std ::分配器&LT;焦炭&GT;&gt;中INT)] + 0x285):未定义的引用为`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x109):未定义的引用`提振:: regex_error :: regex_error(标准::字符串常量和放大器;,提振:: regex_constants :: ERROR_TYPE,INT)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] +量0x114):未定义的引用`提振:: regex_error ::加薪()const的
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x11f):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x2e0):未定义的引用`提振:: regex_error :: regex_error(标准::字符串常量和放大器;,提振:: regex_constants :: ERROR_TYPE,INT)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x2eb):未定义的引用`提振:: regex_error ::加薪()const的
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x2f6):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x345):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: fixup_recursions(升压:: re_detail :: re_syntax_base *)] + 0x382):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmaps(升压:: re_detail :: re_syntax_base *)] + 0x179):未定义的引用`提振:: regex_error :: regex_error(标准::字符串常量和放大器;,提振:: regex_constants :: ERROR_TYPE,INT)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmaps(升压:: re_detail :: re_syntax_base *)] +量0x184):未定义的引用`提振:: regex_error ::加薪()const的
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmaps(升压:: re_detail :: re_syntax_base *)] + 0x18f):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmaps(升压:: re_detail :: re_syntax_base *)] + 0x2d6):未定义的引用`提振:: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmap(升压:: re_detail :: re_syntax_base *,无符号字符*,无符号整型*,unsigned char型)] + 0x23d):未定义的引用`的boost :: regex_error :: regex_error(标准::字符串常量和放大器;,的boost :: regex_constants :: ERROR_TYPE,INT)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmap(升压:: re_detail :: re_syntax_base *,无符号字符*,无符号整型*,unsigned char型)] + 0x248):未定义的引用`的boost :: regex_error ::加薪()const的
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmap(升压:: re_detail :: re_syntax_base *,无符号字符*,无符号整型*,unsigned char型)] + 0x253):未定义的引用`的boost :: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: create_startmap(升压:: re_detail :: re_syntax_base *,无符号字符*,无符号整型*,unsigned char型)] + 0x947):未定义的引用`的boost :: regex_error ::〜regex_error()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type)常量] + 0x89上):未定义的引用`提振:: re_detail :: get_default_error_string(升压:: regex_constants :: ERROR_TYPE)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type)常量] + 0xe7):未定义的引用`的boost :: re_detail :: get_default_error_string(升压:: regex_constants :: ERROR_TYPE)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE12insert_stateEiNS0_19syntax_element_typeEj[boost::re_detail::basic_regex_creator<char,提高:: regex_traits&LT;焦炭,提振:: cpp_regex_traits&LT;&烧焦GT; &GT; &GT; :: insert_state(INT,提振:: re_detail :: syntax_element_type,无符号整型)] + 0x94的):未定义的引用`提振:: re_detail :: raw_storage ::插入(无符号整数,无符号整型)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,提高:: re_detail :: cpp_regex_traits_implementation&LT;&烧焦GT; &GT; ::得到(升压:: re_detail :: cpp_regex_traits_base&LT;焦炭&GT;常量和放大器;,无符号整型)] + 0X1E):未定义的引用`提振:: scoped_static_mutex_lock :: scoped_static_mutex_lock(升压:: static_mutex&放;,布尔)'
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,提高:: re_detail :: cpp_regex_traits_implementation&LT;&烧焦GT; &GT; ::得到(升压:: re_detail :: cpp_regex_traits_base&LT;焦炭&GT;常量和放大器;,无符号整型)] + 0x59):未定义的引用`提振:: scoped_static_mutex_lock ::〜scoped_static_mutex_lock()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,提高:: re_detail :: cpp_regex_traits_implementation&LT;&烧焦GT; &GT; ::得到(升压:: re_detail :: cpp_regex_traits_base&LT;焦炭&GT;常量和放大器;,无符号整型)] + 0xdf):未定义的引用`提振:: scoped_static_mutex_lock ::〜scoped_static_mutex_lock()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE18lookup_collatenameEPKcS4_[boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char *常量,字符常量*)常量] + 0x10f):未定义的引用`提振:: re_detail :: lookup_default_collate_name(标准::字符串常量和放大器;)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEv[boost::re_detail::cpp_regex_traits_implementation<char>::init()]+0xe3):未定义的引用`的boost :: re_detail :: raise_runtime_error(的std :: runtime_error常量和放大器;)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEv[boost::re_detail::cpp_regex_traits_implementation<char>::init()]+0x11a):未定义的引用`提振:: re_detail :: get_default_error_string(升压:: regex_constants :: ERROR_TYPE)
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x1f):未定义的引用`提振:: scoped_static_mutex_lock :: scoped_static_mutex_lock(升压:: static_mutex&放;,布尔)'
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x3e):未定义的引用`的boost :: scoped_static_mutex_lock ::〜scoped_static_mutex_lock()
C:\\Users\
ate\\AppData\\Local\\Temp\\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x56):未定义的引用`的boost :: scoped_static_mutex_lock ::〜scoped_static_mutex_lock()
collect2:劳工处返回1退出状态
编辑:正如迈克尔·伯尔的建议,我跑了G ++ -Wl --verbose。下面是它的输出:
使用内置的规格。
COLLECT_GCC = G ++
COLLECT_LTO_WRAPPER = C:/开发/ MinGW的/ bin中/../的libexec / GCC / i686的-PC-的mingw32 / 4.6.1 / LTO-wrapper.exe
目标:为i686-PC-的mingw32
preFIX = / C /温度/ GCC /目标--enable-语言= C,C ++ --with拱= i686的--with调整=通用--disable - ../src/configure:与配置-libstdcxx-PCH --disable-NLS --disable共享--disable-sjlj的异常--disable-Win32的注册表--enable-检查=发行--disable-LTO
线程模型:的Win32
gcc版本4.6.1(GCC)
COLLECT_GCC_OPTIONS =' - O''test.exe的'轮候册'-v''-LC:\\ dev的\\ MinGW的\\''-mtune =通用的'-march = i686的'
C:为/ dev / MinGW的/ bin中/../的libexec / GCC / i686的-PC-的mingw32 / 4.6.1 / cc1plus.exe -quiet -v -i preFIX C:\\ dev的\\ MinGW的\\ BIN \\ .. /lib/gcc/i686-pc-mingw32/4.6.1/ testBoost.cpp -quiet -dumpbase testBoost.cpp -mtune =通用-march = i686的-auxbase testBoost -Wl -version -o C:\\用户\\内特\\ AppData的\\本地的\\ Temp \\ ccX1SmTk.s
cc1plus.exe:错误:无法识别的命令行选项-Wl
GNU C ++(GCC)版本4.6.1(i686的-PC-的mingw32)
由GNU C版本4.6.1,GMP版本5.0.2,MPFR版本3.0.1-P4,MPC 0.9版编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
忽略不存在的目录C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../的i686-PC-的mingw32 /包括
忽略重复目录C:为/ dev / MinGW的/ lib目录/ GCC /../../的lib / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括/ C ++ /4.6.1
忽略重复目录\"c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1/i686-pc-mingw32\"
忽略重复目录C:为/ dev / MinGW的/ lib目录/ GCC /../../的lib / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括/ C ++ /4.6.1/backward
忽略重复目录C:为/ dev / MinGW的/ lib目录/ GCC /../../的lib / GCC / i686的-PC-的mingw32 / 4.6.1 /包括
忽略不存在的目录C:/温度/ GCC /目标/包括
忽略不存在的目录/ C /温度/ GCC /目标/包括
忽略重复目录C:为/ dev / MinGW的/ lib目录/ GCC /../../的lib / GCC / i686的-PC-的mingw32 / 4.6.1 /包括固定
忽略不存在的目录C:为/ dev / MinGW的/ lib目录/ GCC /../../的lib / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../的i686-PC -mingw32 /包括
忽略不存在的目录/ MinGW的/包括
的#include...的搜索从这里开始:
#包括LT&; ...&GT;搜索从这里开始:
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括/ C ++ / 4.6.1
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括/ C ++ / 4.6.1 / i686的-PC-的mingw32
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括/ C ++ / 4.6.1 /后退
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /包括
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /../../../../包括
C:\\ dev的\\ MinGW的\\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.6.1 /包括,固定
搜索列表结束。
GNU C ++(GCC)版本4.6.1(i686的-PC-的mingw32)
由GNU C版本4.6.1,GMP版本5.0.2,MPFR版本3.0.1-P4,MPC 0.9版编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
本使用我的作品罚款 -lboost_regex
在命令行上传递(从nuwen.net MinGW的-7.2.exe
分布 - 没有别的做分配新开包 - 包含编译器和增强你提到的版本)
尝试传递选项轮候册, - 详细
有GNU LD
连接器是详细了解它的寻找库 - 可能给你一个线索。也许一些隐藏的选项/环境设置导致错误的libboost_regex.a被拾起?
要尝试的另一件事是为库作为输入文件的完整路径和文件名传递给 G ++
(不带选项) - GCC将弄清楚,这是一个库文件(和lib目录搜索不会为它做)。因此,假如你已经安装在 MinGW的Ç:\\ dev的\\称为Mingw
,在命令行应该是这样的:
G ++ -o测试-LC:\\ dev的\\ MinGW的testBoost.cpp C:\\ dev的\\ MinGW的\\ lib目录\\ libboost_regex.a
如果这样的作品,那么你有被发现与错误的库一个问题,你需要修复构建脚本/编译配置,否则你会继续有在道路上的问题。如果仍然不行,则库可能已损坏 - 尝试下载并/或再次提取 nuwen.net
分布。或尝试从头开始构建Boost库(这可能需要一段时间)。
I downloaded the nuwen distribution of MinGW, which comes with Boost (GCC 4.6.1 and Boost 1.47.0.). I want to use the Boost regex package in a c++ program. libboost_regex.a is contained in C:\dev\MinGW\lib, which is in my path as well as the library search path for MinGW. When I compile, it gives me lots and lots of errors. I tried giving it the exact path to the library in the g++ command line, but to no avail. My best attempt at compiling: g++ -o test -LC:\dev\MinGW -lboost_regex testBoost.cpp
. The program I'm trying to run:
#include <iostream>
#include <boost/regex.hpp>
int main (int argc, char* argv[])
{
static const boost::regex exp ("hello regex!");
}
My humongous pile of errors:
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail27cpp_regex_traits_char_layerIcEC2ERKNS0_21cpp_regex_traits_baseIcEE[boost::re_detail::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail::cpp_regex_traits_base<char> const&)]+0x20): undefined reference to `boost::re_detail::cpp_regex_traits_char_layer<char>::init()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail11raw_storage6extendEj[boost::re_detail::raw_storage::extend(unsigned int)]+0x41): undefined reference to `boost::re_detail::raw_storage::resize(unsigned int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)]+0x214): undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)]+0x21f): undefined reference to `boost::regex_error::raise() const'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)]+0x22a): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail18basic_regex_parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_15regex_constants10error_typeEiSsi[boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)]+0x285): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x109): undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x114): undefined reference to `boost::regex_error::raise() const'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x11f): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x2e0): undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x2eb): undefined reference to `boost::regex_error::raise() const'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x2f6): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x345): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16fixup_recursionsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)]+0x382): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*)]+0x179): undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*)]+0x184): undefined reference to `boost::regex_error::raise() const'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*)]+0x18f): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE16create_startmapsEPNS0_14re_syntax_baseE[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*)]+0x2d6): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail::re_syntax_base*, unsigned char*, unsigned int*, unsigned char)]+0x23d): undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail::re_syntax_base*, unsigned char*, unsigned int*, unsigned char)]+0x248): undefined reference to `boost::regex_error::raise() const'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail::re_syntax_base*, unsigned char*, unsigned int*, unsigned char)]+0x253): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE15create_startmapEPNS0_14re_syntax_baseEPhPjh[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail::re_syntax_base*, unsigned char*, unsigned int*, unsigned char)]+0x947): undefined reference to `boost::regex_error::~regex_error()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0x89): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0xe7): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail19basic_regex_creatorIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE12insert_stateEiNS0_19syntax_element_typeEj[boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::insert_state(int, boost::re_detail::syntax_element_type, unsigned int)]+0x94): undefined reference to `boost::re_detail::raw_storage::insert(unsigned int, unsigned int)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned int)]+0x1e): undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned int)]+0x59): undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE3getERKS3_j[boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned int)]+0xdf): undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZNK5boost9re_detail31cpp_regex_traits_implementationIcE18lookup_collatenameEPKcS4_[boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const]+0x10f): undefined reference to `boost::re_detail::lookup_default_collate_name(std::string const&)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEv[boost::re_detail::cpp_regex_traits_implementation<char>::init()]+0xe3): undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEv[boost::re_detail::cpp_regex_traits_implementation<char>::init()]+0x11a): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x1f): undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x3e): undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
C:\Users\nate\AppData\Local\Temp\ccTuJyrB.o:testBoost.cpp:(.text$_ZN5boost16cpp_regex_traitsIcE16get_catalog_nameEv[boost::cpp_regex_traits<char>::get_catalog_name()]+0x56): undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
collect2: ld returned 1 exit status
Edit: As suggested by Michael Burr, I ran g++ -Wl --verbose. Here is the output from it:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/dev/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.6.1/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest --enable-languages=c,c++ --with-arch=i686 --with-tune=generic --disable-libstdcxx-pch --disable-nls --disable-shared --disable-sjlj-exceptions --disable-win32-registry --enable-checking=release --disable-lto
Thread model: win32
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-o' 'test.exe' '-Wl' '-v' '-LC:\dev\MinGW\' '-mtune=generic' '-march=i686'
c:/dev/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.6.1/cc1plus.exe -quiet -v -iprefix c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/ testBoost.cpp -quiet -dumpbase testBoost.cpp -mtune=generic -march=i686 -auxbase testBoost -Wl -version -o C:\Users\nate\AppData\Local\Temp\ccX1SmTk.s
cc1plus.exe: error: unrecognized command line option '-Wl'
GNU C++ (GCC) version 4.6.1 (i686-pc-mingw32)
compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/../../../../i686-pc-mingw32/include"
ignoring duplicate directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1"
ignoring duplicate directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1/i686-pc-mingw32"
ignoring duplicate directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1/backward"
ignoring duplicate directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/include"
ignoring nonexistent directory "c:/temp/gcc/dest/include"
ignoring nonexistent directory "/c/temp/gcc/dest/include"
ignoring duplicate directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/include-fixed"
ignoring nonexistent directory "c:/dev/mingw/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.6.1/../../../../i686-pc-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1/i686-pc-mingw32
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include/c++/4.6.1/backward
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/include
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/../../../../include
c:\dev\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/include-fixed
End of search list.
GNU C++ (GCC) version 4.6.1 (i686-pc-mingw32)
compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
This works fine for me using -lboost_regex
passed on the command line (mingw-7.2.exe
distribution from nuwen.net - freshly unpacked with nothing else done to the distribution - which contains the compiler and boost versions you mentioned).
Try passing the option -Wl,--verbose
to have the gnu ld
linker be verbose about where it's looking for the libraries - that might give you a clue. Maybe some hidden option/environment setting is causing the wrong libboost_regex.a to be picked up?
Another thing to try is to pass the full path and filename for the library as an input file to g++
(with no options) - GCC will figure out that it's a library file (and a lib directory search will not be done for it). So assuming that you have MinGW installed in C:\dev\Mingw
, the command line should look like:
g++ -o test -LC:\dev\MinGW testBoost.cpp c:\dev\MinGW\lib\libboost_regex.a
If that works, then you have a problem with the wrong library being found, and you need to fix your build script/build configuration or you'll continue to have problems down the road. If that still doesn't work, then the library might have been corrupted - try downloading and/or extracting the nuwen.net
distribution again. Or try building the Boost libraries from scratch (which may take a while).
这篇关于nuwen MinGW的+助推错误链接boost_regex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!