Boost.Log linking error on OS X El Capitan v10.11.3 and Xcode 7.2 Beta (LLVM 7.0.2, clang -700.1.81)

Viewed 122

I'm new to stack overflow and have a question about Boost.log. I'm very interested on using Boost.log library but I have failed terribly trying to make it work. My setup is described on the "Title". The Boost libraries were succesfully installed throught homebrew, so the "include" and "Cellar" folders can be found on the system and each path to mentioned folder are "included" on Xcode. I'm trying to compile a very basic example:

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;
}

When compiling no errors came up but when the app runs next error pops-up:

dyld: Symbol not found: __ZN5boost3log11v2_mt_posix15parse_formatterIcEENS1_15basic_formatterIT_EEPKS4_S7_ Referenced from: /Users/MMIN/Library/Developer/Xcode/DerivedData/SDL_OSX64_TLOM-hfqbehwlyjmogdapcmgoqggriedk/Build/Products/Debug/SDL_OSX64_TLOM Expected in: /usr/local/lib/libboost_log_setup.dylib in /Users/MMIN/Library/Developer/Xcode/DerivedData/SDL_OSX64_TLOM-hfqbehwlyjmogdapcmgoqggriedk/Build/Products/Debug/SDL_OSX64_TLOM Program ended with exit code: 9

I have reading some blogs and forums and it seems the problem is the gcc version used by homebrew and clang version used by xcode.

Could anyone help me with this issue?

0 Answers
Related