conflicting declaration error when making ACE 7.0.0 with Cygwin64

  ace, c++, cygwin

My operating system is Windows x64

When I try to make ACE using Cygwin I get the following compilation error:

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;

Steps I have done before trying to make:

1- I installed Cygwin64 using the installer and I installed the gcc-g++, gcc-core, make, perl and binutils packages.

2- I ran the cygserver-config script and it finished successfully.

3- I downloaded ACE from https://download.dre.vanderbilt.edu/, I chose the "Full" ACE.zip (7.0.0) from the Micro releases

4- I created the config.h file with #include "ace/config-cygwin32.h" in it and placed it in ACE_wrappers/ace/

5- I created the platform_macros.GNU with "include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU" in it and placed it in ACE_wrappers/include/makeinclude/

6- I opened the Cygwin64 shell and did this:
export PATH=/cygdrive/c/cygwin64/bin:$PATH
export ACE_ROOT=/cygdrive/c/resources/ACE_wrappers

7- I did "cd $ACE_ROOT/ace" then I "make".

For the gcc version (from 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)

Source: Windows Questions C++

LEAVE A COMMENT