我正在尝试编译一个使用线程和锁定空闲队列的程序。我正在开发一个系统(RHEL),它是另一个系统的一部分,该系统已经有一个boost库但是旧版本1.44。因此,我在另一个目录中从源代码构建/安装boost库版本1.56。 但是,当我尝试使用以下命令编译程序时,我收到以下错误: -
g ++ -I / data / ojaved / boost_install -L / data / ojaved / boost_install / lib -pthread -lboost_thread test_boost.cxx
In file included from /usr/include/boost/thread/detail/platform.hpp:17:0,
from /usr/include/boost/thread/thread.hpp:12,
from test_boost.cxx:2:
/usr/include/boost/config/requires_threads.hpp:29:4: error: #error "Threading support
unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
# error "Threading support unavaliable: it has been explicitly disabled with
BOOST_DISABLE_THREADS"
^
In file included from /usr/include/boost/thread/thread.hpp:12:0,
from test_boost.cxx:2:
/usr/include/boost/thread/detail/platform.hpp:67:9: error: #error "Sorry, no boost
threads are available for this platform."
# error "Sorry, no boost threads are available for this platform."
^
In file included from test_boost.cxx:2:0:
/usr/include/boost/thread/thread.hpp:19:2: error: #error "Boost threads unavailable on
this platform"
#error "Boost threads unavailable on this platform"
^
In file included from /usr/include/boost/thread/detail/thread.hpp:11:0,
from /usr/include/boost/thread/thread.hpp:22,
from test_boost.cxx:2:
/usr/include/boost/thread/mutex.hpp:18:2: error: #error "Boost threads unavailable on
this platform"
#error "Boost threads unavailable on this platform"
^
In file included from /usr/include/boost/thread/detail/thread.hpp:13:0,
from /usr/include/boost/thread/thread.hpp:22,
from test_boost.cxx:2:
/usr/include/boost/thread/detail/thread_heap_alloc.hpp:19:2: error: #error "Boost threads
unavailable on this platform"
#error "Boost threads unavailable on this platform"
^
In file included from /usr/include/boost/thread/detail/thread_group.hpp:9:0,
from /usr/include/boost/thread/thread.hpp:24,
from test_boost.cxx:2:
/usr/include/boost/thread/shared_mutex.hpp:18:2: error: #error "Boost threads unavailable
on this platform"
#error "Boost threads unavailable on this platform"
^
test_boost.cxx:3:36: fatal error: boost/lockfree/queue.hpp: No such file or directory
#include <boost/lockfree/queue.hpp>
^
compilation terminated.
在我看来,它仍然找不到新升级库的路径。