开发者

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 is found here /GNUstep/System/Library/Headers/AppKit

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

EDIT:

I just want to build simple utility GUI apps.

Here's the code I wrote:

#import <Cocoa/Cocoa.h>

int main(void)
{
    NSAutoreleasePo开发者_StackOverflowol* pool = [[NSAutoreleasePool alloc] init];

    NSView* myView = [[[NSView alloc] initWithFrame:NSMakeRect(10, 10, 100, 100)]autorelease];

    [pool release];
    return 0;
}

And I got:

$ 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

The reasons I want to develop this app on windows is:

  1. The Target platform for this app to run on is Windows.
  2. I don't have mac. (please don't ask me to buy one)

Thanks.


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/


include this library for linking

-lgnustep-gui
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜