OS X El Capitan v10.11.3和Xcode 7.2 Beta上的Boost.Log链接错误(LLVM 7.0.2,clang -700.1.81)

时间:2016-03-10 04:12:43

标签: c++ xcode macos boost

我是新的堆栈溢出,并对Boost.log有疑问。我对使用Boost.log库非常感兴趣,但我没有尝试让它工作。我的设置在" Title"中描述。 Boost库已成功通过自制软件安装,因此"包括"和" Cellar"文件夹可以在系统上找到,并且提到的文件夹的每个路径都是"包含"在Xcode上。我试图编写一个非常基本的例子:

namespace logging = boost::log;
namespace src = boost::log::sources;
namespace sinks = boost::log::sinks;
namespace keywords = boost::log::keywords;

int main(int argc, const char* argv[])
{
    logging::add_file_log( keywords::file_name = "sample_%N.log", keywords::rotation_size = 10 * 1024 * 1024, keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0), keywords::format = "[%TimeStamp%]: %Message%" );

    logging::core::get()->set_filter( logging::trivial::severity >= logging::trivial::debug );

    BOOST_LOG_TRIVIAL( trace ) << "A trace severity message";
    BOOST_LOG_TRIVIAL( debug ) << "A debug severity message";
    BOOST_LOG_TRIVIAL( info ) << "An informational severity message";
    BOOST_LOG_TRIVIAL( warning ) << "A warning severity message";
    BOOST_LOG_TRIVIAL( error ) << "An error severity message";
    BOOST_LOG_TRIVIAL( fatal ) << "A fatal severity message";*/

    return 0;
}

编译时没有出现错误,但是当应用程序运行下一个错误弹出时:

dyld:找不到符号:__ ZN5boost3log11v2_mt_posix15parse_formatterIcEENS1_15basic_formatterIT_EEPKS4_S7_   参考自:/ Users / MMIN / Library / Developer / Xcode / DerivedData / SDL_OSX64_TLOM-hfqbehwlyjmogdapcmgoqggriedk / Build / Products / Debug / SDL_OSX64_TLOM   预期在:/usr/local/lib/libboost_log_setup.dylib  in / Users / MMIN / Library / Developer / Xcode / DerivedData / SDL_OSX64_TLOM-hfqbehwlyjmogdapcmgoqggriedk / Build / Products / Debug / SDL_OSX64_TLOM 程序以退出代码结束:9

我已经阅读了一些博客和论坛,似乎问题是xb使用的自制软件和clang版本使用的gcc版本。

有人可以帮我解决这个问题吗?

0 个答案:

没有答案