如何解决 ACE 和 Android 之间的冲突声明 (CPU_SET_T)?

How to resolve conflicting declarations (CPU_SET_T) between ACE and Android?

交叉编译目标:Android 7
主持人 OS:Linux
NDK:Crystax 10.3.2 (b912)
OpenDDS:3.11

编译 OpenDDS 失败并报告 C++ 宏声明冲突。 ACE config-android.h 文件定义了...

# define ACE_HAS_CPU_SET_T

... 我已将其注释掉,但无济于事。

有人想过如何解决这个问题吗?这是我在一些 x86_64 构建之后以及 arm 构建开始的地方剪下的错误消息。

.... (snip)
make: Leaving directory '/home/dev/dds-test/OpenDDS-3.11/build/x86_64/dds/idl'
Searching /home/dev/dds-test/ACE_wrappers for files...
Found 25764 files and directories in 0 seconds.
Creating /home/dev/dds-test/ACE_wrappers/build/arm
Finished in /home/dev/dds-test/ACE_wrappers/build/arm
Total time: 1 seconds.
Searching /home/dev/dds-test/OpenDDS-3.11 for files...
Found 5220 files and directories in 0 seconds.
Creating /home/dev/dds-test/OpenDDS-3.11/build/arm
Finished in /home/dev/dds-test/OpenDDS-3.11/build/arm
Total time: 0 seconds.
MPC_ROOT was set to /home/dev/dds-test/ACE_wrappers/build/arm/MPC.
Using .../dds-test/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
CIAO_ROOT was used in the configuration file, but was not defined.
DANCE_ROOT was used in the configuration file, but was not defined.
Generating 'gnuace' output using TAO_ACE.mwc
Skipping SSL_FOR_TAO (ssl_for_tao.mpc); it requires ace_for_tao.
Skipping QoS (qos.mpc); it requires qos.
Skipping ACE_FOR_TAO (ace_for_tao.mpc); it requires ace_for_tao.
Skipping ACE_XML_Utils (XML.mpc); it requires xerces.
Skipping ACE_FoxReactor (ace_foxreactor.mpc); it requires fox.
Skipping ace_svcconf_gen (svcconfgen.mpc); it requires ace_svcconf_gen.
Skipping TAO_FoxResource (FoxResource.mpc); it requires fox.
Skipping Bzip2Compressor (Bzip2Compressor.mpc); it requires bzip2.
Skipping ZlibCompressor (ZlibCompressor.mpc); it requires zlib.
Skipping LzoCompressor (LzoCompressor.mpc); it requires lzo1.
Skipping TAO_IDL_GEN (tao_idl_fe.mpc); it requires tao_idl_fe_gen.
Skipping NamingViewer (NamingViewer.mpc); it requires mfc.
Skipping wxNamingViewer (wxNamingViewer.mpc); it requires wxWindows.
Generation Time: 49s
MPC_ROOT was set to /home/dev/dds-test/ACE_wrappers/build/arm/MPC.
Using .../dds-test/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
CIAO_ROOT was used in the configuration file, but was not defined.
DANCE_ROOT was used in the configuration file, but was not defined.
Generating 'gnuace' output using DDS.mwc
Skipping ishapes (ishapes.mpc); it requires boost.
Skipping DDS_Inconsistent_Qos_Inconsistent_Qos (Inconsistent_Qos.mpc); it requires xerces.
Skipping qos_dump (qos_dump.mpc); it requires xerces.
Skipping FaceUnitTests_SafetyProfilePool (FaceUnitTests.mpc); it avoids no_opendds_safety_profile.
Skipping OpenDDS_XML_QOS_XSC_Generation (qos_xml_handler.mpc); it requires xsc.
Skipping OpenDDS_QOS_XML_XSC_Handler (qos_xml_handler.mpc); it requires xerces.
Skipping OpenDDS_Corba (OpenDDS_Corba.mpc); it avoids no_opendds_safety_profile.
Skipping OpenDDS_CorbaSeq (CorbaSeq.mpc); it avoids no_opendds_safety_profile.
Skipping tao_java (tao_java.mpc); it requires java.
Skipping builtintopics_test (builtintopics_test.mpc); it requires java.
Skipping two_idl (two_idl.mpc); it requires java.
Skipping zerocopy_java_test (zerocopy.mpc); it requires java.
Skipping multirepo_test (multirepo_test.mpc); it requires java.
Skipping hello_java_client (hello_java_client.mpc); it requires java.
Skipping transport_config (transport_config.mpc); it requires java.
Skipping complex_idl_test (complex_idl_test.mpc); it requires java.
Skipping publisher_idl_test (publisher_idl_test.mpc); it requires java.
Skipping java_both_test (java_both_test.mpc); it requires java.
Skipping messenger_idl_test (messenger_idl_test.mpc); it requires java.
Skipping subscriber_idl_test (subscriber_idl_test.mpc); it requires java.
Skipping dcps_java (dcps_java.mpc); it requires java.
Skipping idl2jni_test_simple (idl2jni_test_simple.mpc); it requires java.
Skipping idl2jni_runtime (idl2jni_runtime.mpc); it requires java.
Skipping idl2jni_compact (idl2jni_compact.mpc); it requires java.
Skipping idl2jni_codegen (idl2jni_codegen.mpc); it requires java.
Skipping dissector (dissector.mpc); it requires wireshark.
Generation Time: 31s
calling make -C ace
make: Entering directory '/home/dev/dds-test/ACE_wrappers/build/arm/ace'
make[1]: Entering directory '/home/dev/dds-test/ACE_wrappers/build/arm/ace'
touch .depend.ACE
GNUmakefile: /home/dev/dds-test/ACE_wrappers/build/arm/ace/GNUmakefile.ACE MAKEFLAGS=w

arm-linux-androideabi-g++ -Wno-deprecated-declarations -W -Wall -Wpointer-arith -Wno-psabi -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe  --sysroot=/opt/crystax-ndk/sysroot -I/opt/crystax-ndk/sysroot/usr/include -I/opt/crystax-ndk/include -D_REENTRANT  -D_GNU_SOURCE -DACE_HAS_CUSTOM_EXPORT_MACROS=0  -DNDEBUG  -I/home/dev/dds-test/ACE_wrappers/build/arm -DACE_NDEBUG -D__ACE_INLINE__ -I.. -DACE_AS_STATIC_LIBS  -c  -o .obj/Local_Name_Space.o Local_Name_Space.cpp
In file included from /home/dev/dds-test/ACE_wrappers/build/arm/ace/OS_NS_Thread.h:32:0,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Thread_Mutex.h:31,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Log_Category.h:20,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Malloc.h:24,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Malloc_T.h:18,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Local_Name_Space.h:20,
                 from Local_Name_Space.cpp::
/home/dev/dds-test/ACE_wrappers/build/arm/ace/os_include/os_sched.h:47:6: error: conflicting declaration 'typedef struct cpu_set_t cpu_set_t'
    } cpu_set_t;
      ^
In file included from /opt/crystax-ndk/sysroot/usr/include/sched.h:43:0,       
                 from /opt/crystax-ndk/sysroot/usr/include/crystax/bionic/libc/include/mangled-pthread.h:33,
                 from /opt/crystax-ndk/sysroot/usr/include/pthread.h:43,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/os_include/os_pthread.h:54,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/OS_NS_Thread.h:31,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Thread_Mutex.h:31,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Log_Category.h:20,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Malloc.h:24,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Malloc_T.h:18,
                 from /home/dev/dds-test/ACE_wrappers/build/arm/ace/Local_Name_Space.h:20,
                 from Local_Name_Space.cpp:3:
/opt/crystax-ndk/sysroot/usr/include/crystax/bionic/libc/include/mangled-sched.h:73:3:note: previous declaration as 'typedef struct cpu_set_t cpu_set_t'
 } cpu_set_t;
   ^
/home/dev/dds-test/ACE_wrappers/build/arm/include/makeinclude/rules.local.GNU:188: recipe for target '.obj/Local_Name_Space.o' failed
make[1]: *** [.obj/Local_Name_Space.o] Error 1
make[1]: Leaving directory '/home/dev/dds-test/ACE_wrappers/build/arm/ace'
GNUmakefile:45: recipe for target 'ACE' failed
make: *** [ACE] Error 2
make: Leaving directory '/home/dev/dds-test/ACE_wrappers/build/arm/ace'
calling TAO_ROOT make
... (snip)

这可以通过使用 TAO 6.4.3 和 ACE 2.4.3 来解决,您可以从 Vanderbilt University. Look at the INSTALL for instructions how to set your own ACE/TAO version instead of downloading the OCI version as part of the configure script. I have made a pull request for OpenDDS to extend the configure script with a new option to let it download ACE/TAO from Vanderbilt University, hopefully that makes it into OpenDDS 3.12

下载