I remember having seen similar stuff in the past (but thats like 10 years ago) 
when I ported Mac code to Linux. The work around was to force initialisation 
for some stuff.
Unfortunately I can't remember what was my workaround for it but it might be 
stuff which NSApplication initializes which never gets called when you call 
NSLog from main directly.

> On 4 Jul 2023, at 09:28, Frederik Seiffert <[email protected]> wrote:
> 
> That exit code is STATUS_ACCESS_VIOLATION, I’m guessing it’s crashing 
> somewhere in the GNUstep initialization.
> https://www.magnumdb.com/search?q=1073741819
> 
> I think you won’t get any further without using a debugger to get a stack 
> trace of the crash. You should be able to use either Visual Studio or lldb 
> for that.
> 
>> Am 04.07.2023 um 03:02 schrieb bellabs <[email protected]>:
>> 
>> Hello RK, first of all thank you for your reply and advice. I am currently 
>> using gnustep-tools-windows-msvc, but the program does not work properly 
>> using code that involves objects, such as the following code:
>> @interface HelloWorld : NSObject
>> - (void)sayHello;
>> @end
>> 
>> @implementation HelloWorld
>> - (void)sayHello {
>>      NSLog(@"Helo RK");
>> }
>> @end
>> 
>> int main() {
>>      printf("1111111111111111111111111111111111111\n");
>>      HelloWorld *hello = [[HelloWorld alloc] init];
>>         printf("222222222222222222222222222222222\n");
>>      [hello sayHello];
>>      printf("3333333333333333333333333333333333333\n");
>> 
>>      return 0;
>> }
>> 
>> 
>> log
>> C:\demo>a.exe
>> 1111111111111111111111111111111111111
>> 
>> C:\demo>echo %errorlevel%
>> -1073741819
>> 
>> All the gnustep libraries and compilation commands I use are provided by 
>> https://github.com/gnustep/tools-windows-msvc.
>> This means that the program is terminated after only the first printf 
>> statement is executed. I have tested this code on linux and it is fully 
>> compiled and run properly. Do you know what is going on here? Thanks!
>> 
>> Best regards!
> 

Reply via email to