zoukankan      html  css  js  c++  java
  • linux环境下编译问题

    最近项目刚开始起动,一些底层库编写用到boost,在编译过程中遇到一些奇怪问题,在此记录下

    1.库的连接顺序问题,比如a依赖b,连接的时候要先连接a,eg -L  -a -b;

    2.boost库的问题,库里面用到boost,生成库文件没有问题,但是到工程文件生成引用到库文件的时候,提示:

     undefined reference to `boost::system::get_system_category()'

     undefined reference to `boost::system::get_generic_category()'

    查看了源代码,原来需要定义宏 BOOST_SYSTEM_NO_DEPRECATED

    # ifndef BOOST_SYSTEM_NO_DEPRECATED
      inline const error_category & get_system_category() { return system_category(); }
      inline const error_category & get_generic_category() { return generic_category(); }
      inline const error_category & get_posix_category() { return generic_category(); }
      static const error_category & posix_category = generic_category();
      static const error_category & errno_ecat = generic_category();
      static const error_category & native_ecat = system_category();
    # endif

    所以在生成库文件时候(我的是libkernel.a)要定义这个宏,

    boost system库确实没有找到这几个函数,所以你的工程最好也定义这个宏,不要引用这些方法。

  • 相关阅读:
    13.sqoop的安装
    12.Flume的安装
    11.把文本文件的数据导入到Hive表中
    10.hive安装
    9.centos7 安装mysql
    8.时间同步
    7.编写mapreduce案例
    mysql中如何处理字符
    装箱拆箱隐含的问题
    何谓幂等性
  • 原文地址:https://www.cnblogs.com/moon-in-sky/p/3944343.html
Copyright © 2011-2022 走看看