tools-windows-msvc runtime error

loserist <[email protected]> Sun, 16 Jul 2023 10:12:03 +0800 (GMT+08:00)
Newsgroups gmane.comp.lib.gnustep.devel,gmane.comp.lib.gnustep.general,gmane.comp.lib.gnustep.bugs
Message-ID <[email protected]>
I know this is an error usually caused by null pointers, but my code has been tested to be fine under linux. When I compile and run my program on windows using tools-windows-msvc provided by gnustep, I get this error, and I suspect that it is caused by one of gnustep's own libraries on windows, specifically the objc library, but I can't do anything about it and I don't know how to fix it, so I'm putting this question to you so I'm sending this problem back to you for fixing. Finally, thanks for the replies and I'll post my code below at the end!







|

#import <Foundation/Foundation.h>

@interface SayHello : NSObject

- (void)greet;

@end

@implementation SayHello

- (void)greet {

NSLog(@"Hello GnuStep");

}

@end

int main() {

NSLog(@"*************************"); // Ok

SayHello *obj = [[SayHello alloc] init]; // Oops!

NSLog(@"###########################"); // No

[obj greet]; // No

NSLog(@"##########################"); // No

}

|