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

时间:2017-06-08 00:16:59

标签: android ace data-distribution-service opendds

交叉编译目标:Android 7
主机操作系统: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)

1 个答案:

答案 0 :(得分:1)

这可以通过使用TAO 6.4.3和ACE 2.4.3来解决,您可以从Vanderbilt University下载。请查看INSTALL以获取有关如何设置自己的ACE / TAO版本的说明,而不是在配置脚本中下载OCI版本。我为OpenDDS做了一个pull request来扩展配置脚本,使用一个新选项让它从范德比尔特大学下载ACE / TAO,希望它能进入OpenDDS 3.12