0

I installed boost1.71 on my Kubuntu Linux using apt package manager. Then I've added boost include path and link libraries using Cmake to my project:

find_package(Boost 1.71.0 REQUIRED COMPONENTS 
    date_time 
    regex
)
include_directories(${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(TestApp Boost::date_time Boost::regex)

I included these header files in my translation unit and use a simple asio socket programming example.

#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>

however, I get this error message in compile time! (I use g++ compiler by the way)

In file included from /usr/include/boost/predef/os/windows.h:11,
             from /usr/include/boost/predef/platform/windows_runtime.h:13,
             from /usr/include/boost/smart_ptr/detail/yield_k.hpp:28,
             from /usr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp:18,
             from /usr/include/boost/smart_ptr/detail/spinlock.hpp:47,
             from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
             from /usr/include/boost/smart_ptr/shared_ptr.hpp:36,
             from /usr/include/boost/shared_ptr.hpp:17,
             from /usr/include/boost/date_time/time_clock.hpp:17,
             from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:10,
             from /usr/include/boost/asio/time_traits.hpp:23,
             from /usr/include/boost/asio/detail/timer_queue_ptime.hpp:22,
             from /usr/include/boost/asio/detail/deadline_timer_service.hpp:29,
             from /usr/include/boost/asio/basic_deadline_timer.hpp:24,
             from /usr/include/boost/asio.hpp:25,
             from ~/TestApp/main.cpp:18:
/usr/include/boost/predef/os/bsd.h:85:5: error: missing expression between '(' and ')'
   85 | #if BOOST_OS_BSD

Any help would be greatly appreciated.

Thanks in advance

0 Answers0