gpt4 book ai didi

c++ - Boost 1.64 在 solaris 上构建错误

转载 作者:太空狗 更新时间:2023-10-29 21:34:54 25 4
gpt4 key购买 nike

<built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
from ./boost/log/detail/config.hpp:33,
from libs/log/src/attribute_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
^~~~~

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o" "libs/log/src/attribute_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
from ./boost/log/detail/config.hpp:33,
from libs/log/src/attribute_value_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
^~~~~

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o" "libs/log/src/attribute_value_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/code_conversion.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined




...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>attribute_name.o...
...skipped <pstage/lib>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0...
...skipped <pstage/lib>libboost_log.so for lack of <pstage/lib>libboost_log.so.1.64.0...
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
from ./boost/log/detail/config.hpp:33,
from ./boost/log/detail/setup_config.hpp:20,
...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>setup/parser_utils.o...
...skipped <pstage/lib>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0...
...skipped <pstage/lib>libboost_log_setup.so for lack of <pstage/lib>libboost_log_setup.so.1.64.0...

使用 GCC 6.2 版本构建 Boost C++ Libraries 1.64 时有一些错误日志。有什么问题?它是众多错误日志之一。

$b2

这发生在执行上述命令期间。日志和 python 库有大量的错误日志。

我想知道为什么会出现这个错误。

  • 搭建环境
  • Oracle Solaris 11.2 x86 2014 年 6 月 23 日
  • 海湾合作委员会 6.2
  • 构建目标
  • Boost C++ 库 1.64

最佳答案

我认为您在 feature_test.h 中达到了这一 block 标准检查:

#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
(defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
require the use of c99"
#endif

这是触发的第一个#error。

UNIX 标准有许多(令人困惑的)名称,POSIX、Xopen、IEEE XPG、SUS。在使用 Single Unix Standard 3 (SUSv3) C90 之前。 SUSv3 及之后使用 C99。 g++ 6.2,对于 C++ 默认为 C++14 也设置了 c11 标志(#define __STDC_VERSION__ 201112L)

所有这一切的结果是您可能需要设置 _XPG6 宏。通常你不会直接这样做,你应该将 _XOPEN_SOURCE 设置为 600,我看到它在你的命令行中设置为 500。

关于c++ - Boost 1.64 在 solaris 上构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44843940/

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