Catalina usr/include

Hi,


It seems usr/include is obsoleted. I am trying to build a project which has many frameworks that point to usr/inlcude. They fail on build complaining they cant find usr/include. They are right, it is not there..


I think the wrong apporach is to copy those files from somewhere back over to usr/include. the project needs to know where Catalina has mysteriously put those files. Any ideas how I can simply and easily point the project, and all the cocoapods it depends upon (around 24) to use the new directory? I dont think I can touch the cocoapods settings, and probably shouldnt. I can however, change the settings in my Xcode project? Or set a file somewhere om the Mac itself?


Thanks..

Replies

Are the headers trying to be accessed system header files, or 3rd party header files that previously would have been added to /usr/include? Is that path hardcoded in to the include pathname? /usr is now read-only except for /usr/local, so you couldn't create a /usr/include even if you wanted to (even with SIP disabled). The system headers are accessed in either the Xcode.app Developer directory, or, if you are using the command lines tools, /Library/Developer/CommandLineTools/usr. This is all setup by Xcode so accessing <stdio.h> gets to the right stdio.h

Hi there,


They are system files, such as libxml2


The cocoapods etc..look like they are configured ok. In the settings, the header search paths are detailed as -


$(sdkroot)/usr/include/libxml2


Which should find them ok.. But, build stops with error, stating it can find i.e. libxml2


If libxml2 is now bundled in the Xcode app directory, then I would have expected it to be found automatically. I think Xcode needs to be told somehow where to now find i.e. libxml2 (in the case of this project, probably developed way before Catalina released).

I just checked my Xcode installation (Xcode 11.1). The libxml2 directory is in


</Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/usr.include>


For grins, I checked the iPhoneOS.platform chain, and it's there as well. It's also in /Library/Developer/CommandLineTools/Platforms/...


You might want to print out the value of SDKROOT, just to be sure. Also, I think case matters in environment variables. sdkroot != SDKROOT.


Also, did you set HEADER_SEARCH_PATHS in the project build settings? You might want to take that out so the default search paths and sysroot settings are not inadvertently overridden. Have you looked at your build log to make sure the compiler invocation looks right?