使用 Cygwin64 制作 ACE 7.0.0 时出现声明冲突错误

conflicting declaration error when making ACE 7.0.0 with Cygwin64

我的操作系统是Windowsx64

当我尝试使用 Cygwin 制作 ACE 时,出现以下编译错误:

In file included from /cygdrive/c/resources/ACE_wrappers/ace/OS_NS_Thread.h:30,
             from /cygdrive/c/resources/ACE_wrappers/ace/Thread_Mutex.h:29,
             from /cygdrive/c/resources/ACE_wrappers/ace/Log_Category.h:18,
             from /cygdrive/c/resources/ACE_wrappers/ace/ACE.cpp:9:
/cygdrive/c/resources/ACE_wrappers/ace/os_include/os_sched.h:45:6: error: conflicting declaration ‘typedef struct cpu_set_t cpu_set_t’
   45 |    } cpu_set_t;
      |      ^~~~~~~~~
In file included from /usr/include/sys/_pthreadtypes.h:12,
                 from /usr/include/sys/types.h:223,
                 from /cygdrive/c/resources/ACE_wrappers/ace/os_include/sys/os_types.h:28,
                 from /cygdrive/c/resources/ACE_wrappers/ace/os_include/os_unistd.h:25,
                 from /cygdrive/c/resources/ACE_wrappers/ace/os_include/os_limits.h:25,
                 from /cygdrive/c/resources/ACE_wrappers/ace/Basic_Types.h:52,
                 from /cygdrive/c/resources/ACE_wrappers/ace/ACE.h:29,
                 from /cygdrive/c/resources/ACE_wrappers/ace/ACE.cpp:1:
/usr/include/sys/cpuset.h:27:3: note: previous declaration as ‘typedef struct cpu_set_t cpu_set_t’
   27 | } cpu_set_t;

我在尝试制作之前完成的步骤:

1- 我使用安装程序安装了 Cygwin64,并安装了 gcc-g++、gcc-core、make、perl 和 binutils 软件包。

2- 我 运行 cygserver-config 脚本并成功完成。

3- 我从 https://download.dre.vanderbilt.edu/ 下载了 ACE,我从 Micro 版本

选择了“完整版”ACE.zip (7.0.0)

4- 我创建了 config.h 文件,其中包含 #include "ace/config-cygwin32.h" 并将其放在 ACE_wrappers/ace/

5- 我创建了 platform_macros.GNU,其中包含“include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU”,并将其放在 ACE_wrappers/include/makeinclude/

6- 我打开了 Cygwin64 shell 并执行了以下操作: 导出路径=/cygdrive/c/cygwin64/bin:$路径 导出 ACE_ROOT=/cygdrive/c/resources/ACE_wrappers

7- 我做了 "cd $ACE_ROOT/ace" 然后我 "make".

对于 gcc 版本(来自 Cygwin shell gcc -v):

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/cygdrive/c/cygwin64/bin/../lib/gcc/x86_64-pc-cygwin/10/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0/configure --srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --with-gcc-major-version-only --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath --enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)

cygwin64 端口未得到积极维护,因此您需要为此更新 ace/config-win32.h。您需要尝试将哪些定义添加到该文件中,当您完成并成功后,请在 https://github.com/DOCGroup/ACE_TAO

上游贡献您的更改

https://github.com/DOCGroup/ACE_TAO 的问题部分更适合解答任何 ACE 问题。