On Nov 19, 2021, at 00:01, Masha Vecherkovskaya wrote:

> Could someone please have a look, I can’t figure out this one myself. I’m 
> trying to build a program and make fails with
> error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
>   222 | char    *ctermid(char *);
> 
> I’ve attacheched all steps I’ve taken. I have also tried to use apple clang, 
> but configure fails
> 
> Masha
> <strelka make.txt>

So you're looking for help compiling something called "strelka" using MacPorts 
gcc11 on macOS 10.14. And it is failing with this error:


In file included from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
                 from /opt/local/include/gcc11/c++/cwchar:44,
                 from /opt/local/include/gcc11/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc11/c++/iosfwd:40,
                 from /opt/local/include/gcc11/c++/iterator:64,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/next_prior.hpp:15,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/utility.hpp:18,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/somatic_result_set.hh:27,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/SomaticIndelVcfWriter.hh:26,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/SomaticIndelVcfWriter.cpp:23:
/opt/local/lib/gcc11/gcc/x86_64-apple-darwin18/11.2.0/include-fixed/stdio.h:222:10:
 error: conflicting declaration of 'char* ctermid(char*)' with 'C' linkage
  222 | char    *ctermid(char *);
      |          ^~~~~~~
In file included from 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:525,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/config/stdlib/libstdcpp3.hpp:78,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/config.hpp:48,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/core/addressof.hpp:15,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/utility/addressof.hpp:15,
                 from 
/Applications/strelka/build/bootstrap/boost/include/boost/utility.hpp:12,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/somatic_result_set.hh:27,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/SomaticIndelVcfWriter.hh:26,
                 from 
/Applications/strelka/src/c++/lib/applications/strelka/SomaticIndelVcfWriter.cpp:23:
/opt/local/lib/gcc11/gcc/x86_64-apple-darwin18/11.2.0/include-fixed/_ctermid.h:26:10:
 note: previous declaration with 'C++' linkage
   26 | char    *ctermid(char *);
      |          ^~~~~~~


The first question I would have is: Why use gcc? Can you use clang instead? If 
so, do that. Clang is the preferred toolchain on macOS.

If gcc is required and that requirement cannot be removed, then you might try 
the gcc-devel port to get a development version of gcc that's newer than 
version 11. Maybe this is a gcc bug that has already been fixed after version 
11. If not, you may have to report to the bug to the developers of gcc for a 
fix.

According to this 
https://github.com/Illumina/strelka/blob/master/docs/userGuide/installation.md#prerequisites-to-build-from-source
 (if that is indeed the same strelka as the one you're trying to compile) only 
a C++11-compatible compiler is required, either gcc or clang.

Reply via email to