New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-isysroot missing #8811
Comments
I just wanted to add here that cross-compiling to iOS is untested waters plus the linker |
|
@kubkon Not sure if I'm missing something, but even after passing I have the following minimal #import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(id)options
{
CGRect mainScreenBounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:mainScreenBounds];
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.backgroundColor = [UIColor whiteColor];
viewController.view.frame = mainScreenBounds; UILabel *label = [[UILabel alloc] initWithFrame:mainScreenBounds];
[label setText:@"Hello world!"];
[viewController.view addSubview: label]; self.window.rootViewController = viewController; [self.window makeKeyAndVisible];
return YES;
}
@end
int main(int argc, char *argv[])
{
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
appDelegateClassName = NSStringFromClass([AppDelegate class]);
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
} Then, with zig version
and I get the following:
|
You'll definitely need to pass |
No luck, just tried I'm passing |
Cool, thanks for the report! I'll reopen the issue then. |
Excellent point @jmrico01, closing! |
I'm trying to make an iOS app. To cross-compile from macOS to iOS,
-isysroot
needs to be specified to find frameworks.The clang build command
clang -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -framework Foundation -framework UIKit -framework QuartzCore -lobjc main.c
can't be run usingzig cc
orzig build-exe
because-isysroot
is missing and without it, frameworks are not found.Sample objective-c file that should be possible to compile with
zig cc
/zig build-exe
:The text was updated successfully, but these errors were encountered: