3

I am having issues with header files on macOS Catalina. I get command-line tool errors like the following :

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:29: error: parameter name omitted
 int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
                             ^~~

and gcc errors

/usr/local/Cellar/gcc@8/8.3.0/lib/gcc/8/gcc/x86_64-apple-darwin18/8.3.0/include-fixed/math.h:535:15: error: storage class specified for parameter 'nextafte'
 extern double nextafter(double, double);

I dig into header files and gcc on macOS Catalina use this answer as a reference point. The answer states

Regarding header locations, I have Apples headers in /Library/Developer/CommandLineTools/:

$ sudo find /Library -name stdio.h 
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.

When I run the same command, the header locations are slightly different:

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/stdio.h

As can be seen the SDKs are now split into MACOSX10.14 and 10.15 unlinke before. Another difference is with the header files. According the the answer in reference,

if you install gcc via brew, it will add headers in /usr/local/:

$ sudo find /usr -name stdio.h 
/usr/local/Cellar/gcc/8.2.0/include/c++/8.2.0/tr1/stdio.h
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include/ssp/stdio.h
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include-fixed/stdio.h
/usr/local/Cellar/gcc/8.1.0/include/c++/8.1.0/tr1/stdio.h
/usr/local/Cellar/gcc/8.1.0/lib/gcc/8/gcc/x86_64-apple-darwin17.5.0/8.1.0/include/ssp/stdio.h
/usr/local/Cellar/gcc/8.1.0/lib/gcc/8/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h
/usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/tr1/stdio.h
/usr/local/Cellar/gcc/7.3.0_1/lib/gcc/7/gcc/x86_64-apple-darwin17.3.0/7.3.0/include/ssp/stdio.h
/usr/local/Cellar/gcc@7/7.3.0/include/c++/7.3.0/tr1/stdio.h
/usr/local/Cellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-apple-darwin17.5.0/7.3.0/include/ssp/stdio.h
/usr/local/Cellar/gcc@7/7.3.0/lib/gcc/7/gcc/x86_64-apple-darwin17.5.0/7.3.0/include-fixed/stdio.h
/usr/local/include/c++/8.2.0/tr1/stdio.h
/usr/local/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include/ssp/stdio.h
/usr/local/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include-fixed/stdio.h

However, when I run the above command I get:

/usr/local/Cellar/gcc@8/8.3.0/include/c++/8.3.0/tr1/stdio.h
/usr/local/Cellar/gcc@8/8.3.0/lib/gcc/8/gcc/x86_64-apple-darwin18/8.3.0/include/ssp/stdio.h
/usr/local/Cellar/gcc@8/8.3.0/lib/gcc/8/gcc/x86_64-apple-darwin18/8.3.0/include-fixed/stdio.h

Where are the other header files? What should these commands return in macOS Catalina?

rrz0
  • 2,182
  • 5
  • 30
  • 65
  • I have the same issue. In OSX 10.14., all the headers in /Include could be installed from /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg but the same pkg file is not there under 10.15. – akh22 Oct 13 '19 at 00:09
  • Any suggestions on what can be done? Could you up-vote/share if you have the same issue, maybe others who have solved this issue will see the question? – rrz0 Oct 13 '19 at 06:07

1 Answers1

0

Referring you to this solution. I have answered there yesterday. It will be useful if you usually write C/C++ codes and looking for C/C++ headers or the previous header files in /usr/include. But in Catalina, there is no /usr/include folder from this update and you may not be able to create /usr/include folder as the system mounts Read-Only mode.

Can't compile a C program on a Mac after upgrading to Catalina 10.15

You may try this solution.

Roy
  • 1,189
  • 7
  • 13