gpt4 book ai didi

linux - 没有可用的 boost 线程?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:58:20 24 4
gpt4 key购买 nike

平台:RHEL6.3(圣地亚哥)

Boost 1.55.0,使用 gcc-4.4.7-glibc-2.12.2 编译(我不控制我们的 boost 安装和编译,我只是使用它)

我正在尝试使用 boost_thread 使用 gcc 4.8.2 (glibc-2.17) 编译 C++ 应用程序。

在生成文件中:

BOOST_VERSION :=
BOOST_ROOT := $(DK_ROOT)/boost/1.55.0/gcc-4.4.7/
ifdef ATI_BITS_32
libdir := lib
else
libdir := lib64
endif
BOOST_LIB_DIR := "$(BOOST_ROOT)/$(libdir)/"

ifneq ($(BUILD_TYPE)$(BUILD_REL_SYM),rel)
BOOST_VERSION := -d
endif

LCINCS += $(INCSWITCH) $(BOOST_ROOT)/
LCINCS += $(INCSWITCH) $(BOOST_ROOT)/include/
LCINCS += $(INCSWITCH) $(BOOST_ROOT)/include/boost/

LCINCS += $(INCSWITCH) /contrib/STLport/
LCINCS += $(INCSWITCH) /contrib/STLport/include/

LCINCS += $(INCSWITCH) "/gcc/gcc-4.8.2-glibc-2.17-tls/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/linux/"
LCINCS += $(INCSWITCH) "/gcc/gcc-4.8.2-glibc-2.17-tls/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/"

GCPPFLAGS += -pthread $(DEFSWITCH)_LINUX -fPIC
GCPPFLAGS += $(DEFSWITCH)_LINUX
GLOPTS += -Wl,--unresolved-symbols=ignore-in-shared-libs
#LLOPTS += $(DEFSWITCH)CT_CC_STATIC_LIBSTDCXX=y
LLOPTS += \
-L$(OCLCOMPILER_LIB_DIR) \
-L$(HSASERVICES_LIB_DIR) \
-L$(HSACORE_LIB_DIR) \
-L$(BOOST_LIB_DIR) \
-lrt \
-ldl \
-lgtest \
-lsp3 \
-lboost_chrono-mt$(BOOST_VERSION) \
-lboost_date_time-mt$(BOOST_VERSION) \
-lboost_program_options-mt$(BOOST_VERSION) \
-lboost_system-mt$(BOOST_VERSION) \
-lboost_thread-mt$(BOOST_VERSION)

无论我做什么,当 make 尝试确定依赖项时,我总是得到

Generating Test.cpp dependencies ...
In file included from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/detail/platform.hpp:17:0,
from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/thread_only.hpp:12,
from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/thread.hpp:12,
from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread.hpp:13,
from ../../../../LoggingRegistration/LoggingRegistration.h:33,
from ../../../../Common/Common.h:17,
from ../../../Test.cpp:18:
/home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
# error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
^

我该如何解决?

最佳答案

它们在那里,由我的 makefile 中的一些包含文件添加。这没有什么不同。

玩了很久,终于可以编译了。我有几个问题,其中包括:

使用 STLport 而不是 libc++,混合使用 gcc 4.4.6 构建的库并使用 gcc 4.8.2 进行编译/链接。

一旦我停止使用 STLport,并强制使用 libc++,而不是 libstdc++,我就能够编译和链接。

关于linux - 没有可用的 boost 线程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23416472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com