Question

I compiled Boost 1.54 on my Debian 7 64 bit Linux box and installed it successfully.

However, when trying to use it in my project I'm getting a huge bunch of errors (Full dump is here: http://pastebin.com/zUTcb7vp).

I tried creating a simple test app, which is below (saved in main.cpp):

#include <boost/log/trivial.hpp>
#include <boost/log/utility/init/to_file.hpp>

int main(int, char*[])
{
    BOOST_LOG_TRIVIAL(trace) << " a trace message ";
}

This also fails to compile. I get the following errors (too many characters for stack overflow to handle - full stacktrace here: http://pastebin.com/xiXZZVYb):

g++ -o build/main.o -c -std=c++11 -Wall -g -O0 src/main.cpp
In file included from /usr/local/include/boost/log/utility/init/to_file.hpp:31:0,
                 from src/main.cpp:2:
/usr/local/include/boost/log/detail/prologue.hpp:253:36: error: declaration of namespace ‘boost::log’ conflicts with
In file included from /usr/local/include/boost/log/trivial.hpp:20:0,
                 from src/main.cpp:1:
/usr/local/include/boost/log/detail/config.hpp:371:15: error: previous declaration of namespace ‘boost::log’ here
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:59:20: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:59:20: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:59:43: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp: In function ‘int boost::log2_mt_posix::aux::setup_file_collector(const ArgsT&, const true_&)’:
/usr/local/include/boost/log/utility/init/to_file.hpp:61:24: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:61:24: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:61:47: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp: At global scope:
/usr/local/include/boost/log/utility/init/to_file.hpp:64:20: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:64:20: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:64:43: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp: In function ‘int boost::log2_mt_posix::aux::setup_file_collector(const ArgsT&, const false_&)’:
/usr/local/include/boost/log/utility/init/to_file.hpp:66:12: error: ‘sinks’ has not been declared
/usr/local/include/boost/log/utility/init/to_file.hpp: At global scope:
/usr/local/include/boost/log/utility/init/to_file.hpp:72:5: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:72:5: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:75:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp: In function ‘int boost::log2_mt_posix::aux::init_log_to_file(const ArgsT&)’:
/usr/local/include/boost/log/utility/init/to_file.hpp:77:13: error: ‘sinks’ does not name a type
/usr/local/include/boost/log/utility/init/to_file.hpp:78:17: error: ‘backend_t’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:78:27: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:78:38: error: invalid type in declaration before ‘=’ token
/usr/local/include/boost/log/utility/init/to_file.hpp:78:60: error: the value of ‘backend_t’ is not usable in a constant expression
/usr/local/include/boost/log/utility/init/to_file.hpp:78:17: note: ‘backend_t’ was not declared ‘constexpr’
/usr/local/include/boost/log/utility/init/to_file.hpp:80:17: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:80:17: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:80:40: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:80:53: error: invalid type in declaration before ‘=’ token
/usr/local/include/boost/log/utility/init/to_file.hpp:81:63: error: ‘keywords’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:81:63: note: suggested alternatives:
In file included from /usr/local/include/boost/log/trivial.hpp:21:0,
                 from src/main.cpp:1:
/usr/local/include/boost/log/keywords/severity.hpp:29:20: note:   ‘boost::log::v2s_mt_posix::keywords’
/usr/local/include/boost/log/keywords/severity.hpp:29:20: note:   ‘boost::log::v2s_mt_posix::keywords’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:81:91: error: template argument 2 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:81:99: error: expected ‘(’ before ‘>’ token
/usr/local/include/boost/log/utility/init/to_file.hpp:81:99: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:84:17: error: base operand of ‘->’ is not a pointer
/usr/local/include/boost/log/utility/init/to_file.hpp:85:17: error: base operand of ‘->’ is not a pointer
/usr/local/include/boost/log/utility/init/to_file.hpp:85:39: error: ‘keywords’ is not a class, namespace, or enumeration
/usr/local/include/boost/log/utility/init/to_file.hpp:85:63: error: ‘sinks’ is not a class, namespace, or enumeration
/usr/local/include/boost/log/utility/init/to_file.hpp:88:17: error: the value of ‘sinks’ is not usable in a constant expression
/usr/local/include/boost/log/utility/init/to_file.hpp:80:17: note: ‘sinks’ was not declared ‘constexpr’
/usr/local/include/boost/log/utility/init/to_file.hpp:88:68: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class boost::shared_ptr’
/usr/local/include/boost/log/utility/init/to_file.hpp:88:68: error:   expected a type, got ‘sinks’
/usr/local/include/boost/log/utility/init/to_file.hpp:88:76: error: invalid type in declaration before ‘=’ token
/usr/local/include/boost/log/utility/init/to_file.hpp:89:29: error: the value of ‘sinks’ is not usable in a constant expression
/usr/local/include/boost/log/utility/init/to_file.hpp:80:17: note: ‘sinks’ was not declared ‘constexpr’
/usr/local/include/boost/log/utility/init/to_file.hpp:89:16: error: parse error in template argument list
/usr/local/include/boost/log/utility/init/to_file.hpp:89:90: error: no matching function for call to ‘make_shared(int&)’
/usr/local/include/boost/log/utility/init/to_file.hpp:89:90: note: candidates are:
In file included from /usr/local/include/boost/smart_ptr/make_shared.hpp:15:0,
                 from /usr/local/include/boost/make_shared.hpp:15,
                 from /usr/local/include/boost/log/utility/init/to_file.hpp:23,
                 from src/main.cpp:2:
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:138:72: note: template<class T> typename boost::detail::sp_if_not_array::type boost::make_shared()
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:138:72: note:   template argument deduction/substitution failed:
In file included from /usr/local/include/boost/smart_ptr/make_shared.hpp:15:0,
                 from /usr/local/include/boost/make_shared.hpp:15,
                 from /usr/local/include/boost/log/utility/init/to_file.hpp:23,
                 from src/main.cpp:2:
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:210:99: note: template<class T, class Arg1, class ... Args> typename boost::detail::sp_if_not_array<T>::type boost::make_shared(Arg1&&, Args&& ...)
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:210:99: note:   template argument deduction/substitution failed:
In file included from /usr/local/include/boost/smart_ptr/make_shared.hpp:18:0,
                 from /usr/local/include/boost/make_shared.hpp:15,
                 from /usr/local/include/boost/log/utility/init/to_file.hpp:23,
                 from src/main.cpp:2:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:24:5: note: template<class T> typename boost::detail::sp_if_array::type boost::make_shared(std::size_t)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:24:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:42:5: note: template<class T, class ... Args> typename boost::detail::sp_if_array<T>::type boost::make_shared(std::size_t, Args&& ...)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:42:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:59:5: note: template<class T, class ... Args> typename boost::detail::sp_if_size_array<T>::type boost::make_shared(Args&& ...)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:59:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:80:5: note: template<class T> typename boost::detail::sp_if_size_array::type boost::make_shared(const T&)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:80:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:102:5: note: template<class T> typename boost::detail::sp_if_array::type boost::make_shared(std::size_t, const typename boost::detail::array_inner<T>::type&)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:102:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:126:5: note: template<class T> typename boost::detail::sp_if_size_array::type boost::make_shared(const typename boost::detail::array_inner<T>::type&)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:126:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:150:5: note: template<class T> typename boost::detail::sp_if_array::type boost::make_shared(std::initializer_list<typename boost::detail::array_inner<T>::type>)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:150:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:172:5: note: template<class T> typename boost::detail::sp_if_array::type boost::make_shared(std::size_t, typename boost::detail::array_base<T>::type&&)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:172:5: note:   template argument deduction/substitution failed:
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:190:5: note: template<class T> typename boost::detail::sp_if_size_array::type boost::make_shared(typename boost::detail::array_base<T>::type&&)
/usr/local/include/boost/smart_ptr/make_shared_array.hpp:190:5: note:   template argument deduction/substitution failed:
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:91:5: error: ‘setup_filter’ is not a member of ‘boost::log2_mt_posix::aux’
/usr/local/include/boost/log/utility/init/to_file.hpp:91:5: note: suggested alternative:
...
...
TO MANY CHARACTERS - HAD TO TRUNCATE IT DOWN
...
...
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: ‘sinks’ was not declared in this scope
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: note: suggested alternatives:
In file included from /usr/local/include/boost/log/sources/basic_logger.hpp:38:0,
                 from /usr/local/include/boost/log/sources/severity_logger.hpp:23,
                 from /usr/local/include/boost/log/trivial.hpp:22,
                 from src/main.cpp:1:
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
/usr/local/include/boost/log/core/core.hpp:41:17: note:   ‘boost::log::v2s_mt_posix::sinks’
In file included from src/main.cpp:2:0:
/usr/local/include/boost/log/utility/init/to_file.hpp:170:1: error: template argument 1 is invalid

I removed the #include <boost/log/utility/init/to_file.hpp> line, but it still fails to compile.

Anyone have any idea what the heck is going on?

Was it helpful?

Solution

Turns out, I needed to delete the previous Boost files in /usr/local/include/boost and /usr/local/lib/libboost*, then install the new version.

Also, I had to define BOOST_LOG_DYN_LINK in my cpp file (so that my application would dynamically link with Boost Log - I guess I built it as a shared library? I'm not sure why it wouldn't just work with static linking or dynamic linking on its own, but it didn't).

Thanks to Andysem on the boost bug tracker (https://svn.boost.org/trac/boost/ticket/8866).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top