免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234下一页
最近访问板块 发新帖
查看: 9861 | 回复: 35
打印 上一主题 下一主题

[C++] Boost库安装好后代码编译出错,无错误行 [复制链接]

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-07-12 13:07 |只看该作者 |倒序浏览
刚开始使用Boost
Windows 7 64bit
Eclipse+Mingw [gcc version 4.8.1 (rev2, Built by MinGW-builds project)]
boost_1_53_0.7z

从网上找来各种安装代码以及bjam --help产生的安装帮助代码,都会发生这样的问题
  1. bjam.bat install --without-math --without-mpi --without-python toolset=gcc variant=release threading=multi link=shared runtime-link=shared
复制代码
以下错误代码来自Eclipse的提示
  1. 12:55:51 **** Incremental Build of configuration Debug for project RegexBoost ****
  2. Info: Internal Builder is used for build
  3. g++ -o RegexBoost.exe regex.o
  4. regex.o: In function `boost::re_detail::cpp_regex_traits_char_layer<char>::cpp_regex_traits_char_layer(boost::re_detail::cpp_regex_traits_base<char> const&)':
  5. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:369: undefined reference to `boost::re_detail::cpp_regex_traits_char_layer<char>::init()'
  6. regex.o: In function `boost::re_detail::raw_storage::extend(unsigned long long)':
  7. C:/Boost/include/boost/regex/v4/regex_raw_buffer.hpp:131: undefined reference to `boost::re_detail::raw_storage::resize(unsigned long long)'
  8. regex.o: In function `boost::re_detail::save_state_init::save_state_init(boost::re_detail::saved_state**, boost::re_detail::saved_state**)':
  9. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:107: undefined reference to `boost::re_detail::get_mem_block()'
  10. regex.o: In function `boost::re_detail::save_state_init::~save_state_init()':
  11. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail::put_mem_block(void*)'
  12. regex.o: In function `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_imp()':
  13. C:/Boost/include/boost/regex/v4/perl_matcher_common.hpp:206: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
  14. regex.o: In function `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp()':
  15. C:/Boost/include/boost/regex/v4/perl_matcher_common.hpp:292: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
  16. regex.o: In function `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)':
  17. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:1117: undefined reference to `boost::re_detail::put_mem_block(void*)'
  18. regex.o: In function `void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)':
  19. C:/Boost/include/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
  20. regex.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp()':
  21. C:/Boost/include/boost/regex/v4/perl_matcher_common.hpp:292: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
  22. regex.o: In function `boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long long, std::string, long long)':
  23. C:/Boost/include/boost/regex/v4/basic_regex_parser.hpp:220: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long long)'
  24. C:/Boost/include/boost/regex/v4/basic_regex_parser.hpp:221: undefined reference to `boost::regex_error::raise() const'
  25. C:/Boost/include/boost/regex/v4/basic_regex_parser.hpp:221: undefined reference to `boost::regex_error::~regex_error()'
  26. C:/Boost/include/boost/regex/v4/basic_regex_parser.hpp:221: undefined reference to `boost::regex_error::~regex_error()'
  27. regex.o: In function `boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*)':
  28. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:793: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long long)'
  29. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:794: undefined reference to `boost::regex_error::raise() const'
  30. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:793: undefined reference to `boost::regex_error::~regex_error()'
  31. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:875: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long long)'
  32. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:876: undefined reference to `boost::regex_error::raise() const'
  33. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:875: undefined reference to `boost::regex_error::~regex_error()'
  34. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:793: undefined reference to `boost::regex_error::~regex_error()'
  35. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:875: undefined reference to `boost::regex_error::~regex_error()'
  36. regex.o: In function `boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*)':
  37. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:940: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long long)'
  38. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:941: undefined reference to `boost::regex_error::raise() const'
  39. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:940: undefined reference to `boost::regex_error::~regex_error()'
  40. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:940: undefined reference to `boost::regex_error::~regex_error()'
  41. regex.o: In function `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)':
  42. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:1143: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long long)'
  43. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:1144: undefined reference to `boost::regex_error::raise() const'
  44. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:1143: undefined reference to `boost::regex_error::~regex_error()'
  45. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:1143: undefined reference to `boost::regex_error::~regex_error()'
  46. regex.o: In function `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()':
  47. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:213: undefined reference to `boost::re_detail::get_mem_block()'
  48. regex.o: In function `boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const':
  49. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:445: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
  50. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:447: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
  51. regex.o: In function `boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::insert_state(long long, boost::re_detail::syntax_element_type, unsigned long long)':
  52. C:/Boost/include/boost/regex/v4/basic_regex_creator.hpp:321: undefined reference to `boost::re_detail::raw_storage::insert(unsigned long long, unsigned long long)'
  53. regex.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)':
  54. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:1117: undefined reference to `boost::re_detail::put_mem_block(void*)'
  55. regex.o: In function `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 long long)':
  56. C:/Boost/include/boost/regex/pending/object_cache.hpp:66: undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)'
  57. C:/Boost/include/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
  58. C:/Boost/include/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
  59. regex.o: In function `boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const':
  60. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:636: undefined reference to `boost::re_detail::lookup_default_collate_name(std::string const&)'
  61. regex.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()':
  62. C:/Boost/include/boost/regex/v4/perl_matcher_non_recursive.hpp:213: undefined reference to `boost::re_detail::get_mem_block()'
  63. regex.o: In function `boost::re_detail::cpp_regex_traits_implementation<char>::init()':
  64. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:678: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
  65. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:693: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
  66. regex.o: In function `boost::cpp_regex_traits<char>::get_catalog_name()':
  67. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:1062: undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)'
  68. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:1065: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
  69. C:/Boost/include/boost/regex/v4/cpp_regex_traits.hpp:1065: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
  70. collect2.exe: error: ld returned 1 exit status

  71. 12:55:57 Build Finished (took 6s.35ms)

复制代码
以下是在CMD控制台下编译,因为设置的系统环境变量,因此没有添加参数
  1. E:\Documents\workspace\RegexBoost>g++ regex.cpp
  2. D:\Temp\ccFDP1rc.o:regex.cpp:(.text$_ZN5boost9re_detail27cpp_regex_traits_char_l
  3. ayerIcEC2ERKNS0_21cpp_regex_traits_baseIcEE[_ZN5boost9re_detail27cpp_regex_trait
  4. s_char_layerIcEC2ERKNS0_21cpp_regex_traits_baseIcEE]+0x2b): undefined reference
  5. to `boost::re_detail::cpp_regex_traits_char_layer<char>::init()'
  6. D:\Temp\ccFDP1rc.o:regex.cpp:(.text$_ZN5boost9re_detail11raw_storage6extendEy[_Z
  7. N5boost9re_detail11raw_storage6extendEy]+0x5f): undefined reference to `boost::r
  8. e_detail::raw_storage::resize(unsigned long long)'
  9. d:/program files/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_6
  10. 4-w64-mingw32/bin/ld.exe: D:\Temp\ccFDP1rc.o: bad reloc address 0x5f in section
  11. `.text$_ZN5boost9re_detail11raw_storage6extendEy[_ZN5boost9re_detail11raw_storag
  12. e6extendEy]'
  13. collect2.exe: error: ld returned 1 exit status
复制代码

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
2 [报告]
发表于 2013-07-12 13:59 |只看该作者
@pmerofc帮忙看一下这个,谢谢
@starwing83帮忙看一下这个,谢谢
@Ager帮忙看一下这个,谢谢
@群雄逐鹿中原帮忙看一下这个,谢谢
@帅绝人寰帮忙看一下这个,谢谢
@JohnBull帮忙看一下这个,谢谢

论坛徽章:
0
3 [报告]
发表于 2013-07-12 14:07 |只看该作者
boost……饶了我行吗?

先检查一下boost那一大堆包装全了没有,比如libboost_regex之类的

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
4 [报告]
发表于 2013-07-12 14:11 |只看该作者
JohnBull 发表于 2013-07-12 14:07
boost……饶了我行吗?

先检查一下boost那一大堆包装全了没有,比如libboost_regex之类的


我boost的官网上下载了一个7z包,然后参考网上的方法和他的帮助文档编译的,可是有问题.
很多Windows的帮助文档都是那VC或者VS编译的,而且都是些现在下载不到的旧版本

论坛徽章:
4
水瓶座
日期:2013-09-06 12:27:30摩羯座
日期:2013-09-28 14:07:46处女座
日期:2013-10-24 14:25:01酉鸡
日期:2014-04-07 11:54:15
5 [报告]
发表于 2013-07-12 14:19 |只看该作者
用boost不好吧,pure C++比较中规中矩。

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
6 [报告]
发表于 2013-07-12 14:25 |只看该作者
linux_c_py_php 发表于 2013-07-12 14:19
用boost不好吧,pure C++比较中规中矩。


其实我的好奇心在于为啥都设置了C_INCLUDE_PATH 、CPLUS_INCLUDE_PATH 、LIBRARY_PATH之后还是出现大量的错误,而且这些错误在代码中没有提示错误,都是一些以前没有见过的错误,好像是链接有问题

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
7 [报告]
发表于 2013-07-12 14:51 |只看该作者
linux_c_py_php 发表于 2013-07-12 14:19
用boost不好吧,pure C++比较中规中矩。


我不太喜欢VC、VS这些东西,往C盘装的东西太多了

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:17
8 [报告]
发表于 2013-07-12 15:00 |只看该作者
尼玛, 老子今天装了个visual studio 2012, 气的快吐血了, 诅咒了一百遍 啊一百遍, 尼玛居然叫老子这从来不碰windows的人来搞这个……

论坛徽章:
0
9 [报告]
发表于 2013-07-12 15:06 |只看该作者
回复 1# 方兆国


你能否确定环境变量生效呢?

我在windows环境变量问题上被坑过一次,记得以前设置环境变量是有用的,后来某个版本winsdk之后突然不能用了。仔细检查后发现新版本SDK在启动CMD时候先清除了环境变量...

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
10 [报告]
发表于 2013-07-12 15:07 |只看该作者
帅绝人寰 发表于 2013-07-12 15:00
尼玛, 老子今天装了个visual studio 2012, 气的快吐血了, 诅咒了一百遍 啊一百遍, 尼玛居然叫老子这从来 ...

怎么了,不就是占用C盘空间多了些吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP