Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GUI programming with objective-c on Windows?

Is it possible to do GUI programming using Objective-C on Windows?

I am noticing that GNUstep contains headers for AppKit, which are found at /GNUstep/System/Library/Headers/AppKit.

Should I install Project Center for that? Is there a way to write the GUI code by hand?

EDIT:

I just want to build simple utility GUI app.

Here's the code I wrote:

#import <Cocoa/Cocoa.h>

int main(void)
{
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    
    NSView* myView = [[[NSView alloc] initWithFrame:NSMakeRect(10, 10, 100, 100)]autorelease];
    
    [pool release];
    return 0;
}

And I got this error:

$ gcc `gnustep-config --objc-flags` *.m  -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base
HelloGUI.m: In function 'main':
HelloGUI.m:7:10: warning: unused variable 'myView'
C:\Users\mhewedy\AppData\Local\Temp\ccvUXAIj.o:HelloGUI.m:(.data+0xa58): undefined reference to `__objc_class_name_NSView'
collect2: ld returned 1 exit status

I want to do this since I don't have a Mac and don't want to buy one, and my target platform is Windows.

like image 610
Muhammad Hewedy Avatar asked May 29 '26 18:05

Muhammad Hewedy


2 Answers

Yes, it is possible. Check the following links

http://www.gnustep.it/nicola/Tutorials/index.html

http://www.gnustep.it/nicola/Tutorials/WindowsAndButtons/index.html

To write code you can use notepad or 'Gemas' - a lightweight editor, which can be downloaded from the following link.

http://ftp.gnustep.org/pub/gnustep/binaries/windows/

like image 182
vin Avatar answered Jun 01 '26 10:06

vin


include this library for linking

-lgnustep-gui
like image 44
Siva Avatar answered Jun 01 '26 09:06

Siva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!