<div dir="ltr"><div>Hi, <br></div><div><br></div><div>I'm bulding a libTooling utility to inspect some aspects (Preprocessor directives mostly) of the iOS source file (Objective-C for now). But when i run:</div><div><br></div><div>./tool IndexingViewController.m -- -fmodules -std=gnu99 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk <br></div><div><br></div><div>The following errors appear:</div><div><br></div><div>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/usr/include/module.modulemap:118:11: error: header 'stdarg.h' not found<br>   header "stdarg.h" // note: supplied by the compiler<br>          ^<br>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:10: note: <br>      submodule of top-level module 'Darwin' implicitly imported here<br>#include <sys/types.h><br>         ^<br>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:10: fatal error: <br>      'stdarg.h' file not found<br>#include <stdarg.h><br>         ^~~~~~~~~~<br>While building module 'UIKit' imported from ~/Desktop/tool/IndexingViewController.m:1:<br>While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:<br>In file included from <module-includes>:1:<br>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: <br>      could not build module 'CoreFoundation'<br>#include <CoreFoundation/CoreFoundation.h><br> ~~~~~~~~^<br>While building module 'UIKit' imported from  ~/Desktop/tool/IndexingViewController.m:1:<br>In file included from <module-includes>:1:<br>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:9: fatal error: could<br>      not build module 'Foundation'<br>#import <Foundation/Foundation.h><br> ~~~~~~~^<br> ~/Desktop/tool/IndexingViewController.m:1:9: fatal error: could not build module 'UIKit'<br>@import UIKit;</div><div> ~~~~~~~^~~~~<br>5 errors generated</div><div><br></div><div>Error while processing ~/Desktop/tool/IndexingViewController.m.</div><div><br></div><div>It seems that is not finding the includes for iOS witch is weird since is all there. Probably is using some other includes?. If i run the tool without modules enable (-fmodules) i have only one error:</div><div><br></div><div>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h<br>stdarg.h was not found.<br>In file included from~/Desktop/tool/IndexingViewController.m:2:<br>In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:<br>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:10: fatal error: 'stdarg.h'<br>      file not found<br>#include <stdarg.h><br>         ^~~~~~~~~~<br>stdbool.h was not found.</div><div><br></div><div>What i'm doing wrong?</div><div><br></div><div>Thanks<br></div></div>