Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
Discuss [How-To] Install gcc compile at the iPhone Developer Exchange - Hackint0sh.org; I did do something slightly different from the wiki's code, for some reason it had ...
  1. #21
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I did do something slightly different from the wiki's code, for some reason it had some problem with the class when it tried to link.

    I used the following code if it helps:

    main.m:

    Code:
        //
        // main.m
        // HelloSDK
        //
        #import <UIKit/UIKit.h>
        @interface MyView : UIView {
        }
        @end
        @implementation MyView
        - (void)drawRect:(CGRect)rect {
        [[UIColor whiteColor] set];
        [@"Hello World" drawInRect:CGRectMake(0, 100, 320, 50)
        withFont:[UIFont fontWithName:@"Marker Felt" size:50]
        lineBreakMode:UILineBreakModeMiddleTruncation
        alignment:UITextAlignmentCenter];
        }
        @end
    
        @interface HelloSDK2AppDelegate : NSObject {
        UIWindow *window;
        MyView *contentView;
        }
        @property (nonatomic, retain) UIWindow *window;
        @property (nonatomic, retain) MyView *contentView;
        @end
    
        @implementation HelloSDK2AppDelegate
        @synthesize window;
        @synthesize contentView;
    
        - (void)applicationDidFinishLaunching:(UIApplication *)application {
        // Create window
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    
        // Set up content view
        self.contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
        [window addSubview:contentView];
    
        // Show window
        [window makeKeyAndVisible];
        }
    
        - (void)dealloc {
        [contentView release];
        [window release];
        [super dealloc];
        }
        @end
    
        int main(int argc, char *argv[])
        {
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        int retVal = UIApplicationMain(argc, argv, nil, @"HelloSDK2AppDelegate");
        [pool release];
        return retVal;
        }
    Info.plist:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version="1.0">
     <dict>
    	<key>CFBundleDevelopmentRegion</key>
    	<string>English</string>
    	<key>CFBundleExecutable</key>
    	<string>HelloWorldCTRL</string>
    	<key>CFBundleIdentifier</key>
    	<string>com.yourcompany.helloworldwithcontroller</string>
    	<key>CFBundleInfoDictionaryVersion</key>
    	<string>6.0</string>
    	<key>CFBundlePackageType</key>
    	<string>APPL</string>
    	<key>CFBundleSignature</key>
    	<string>????</string>
    	<key>CFBundleVersion</key>
    	<string>1.0</string>
    	<key>SBUsesNetwork</key>
    	<integer>3</integer>
     </dict>
     </plist>
    English.lproj/InfoPlist.strings
    Code:
    CFBundleDisplayName = "Hello World";

    English.lproj/Localizable.strings:
    Code:
    "Hello World" = "Hello World";
    Makefile:
    Code:
    APPNAME=HelloWorldCTRL
    CC=/usr/bin/gcc
    
    CFLAGS=-fsigned-char -g -ObjC -fobjc-exceptions \
      -Wall -Wundeclared-selector -Wreturn-type -Wnested-externs \
      -Wredundant-decls \
      -Wbad-function-cast \
      -Wchar-subscripts \
      -Winline -Wswitch -Wshadow \
      -I/var/include \
      -I/var/include/gcc/darwin/4.0 \
      -D_CTYPE_H_ \
      -D_BSD_ARM_SETJMP_H \
      -D_UNISTD_H_
    
    CPPFLAGS=
    
    LD=$(CC)
    
    LDFLAGS=-lobjc \
      -F/System/Library/Frameworks \
      -framework CoreFoundation \
      -framework Foundation \
      -framework UIKit \
      -framework CoreGraphics \
      -L/usr/lib -lc /usr/lib/libgcc_s.1.dylib \
      -bind_at_load \
      -multiply_defined suppress
    
    
    all:	$(APPNAME)
    
    $(APPNAME):	main.o
    	$(LD) $(LDFLAGS) -o $@ $^
    	/usr/bin/ldid -S $(APPNAME)
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    package: $(APPNAME)
    	rm -fr $(APPNAME).app
    	mkdir -p $(APPNAME).app
    	cp $(APPNAME) $(APPNAME).app/$(APPNAME)
    	cp Info.plist $(APPNAME).app/Info.plist
    	cp -r *.lproj $(APPNAME).app
    	
    clean:
    	rm -rf *.o $(APPNAME) $(APPNAME).app
    appreciate any help, thanks!


  2. #22
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    FYI i eventually got this to work, but dont ask me how...

    I tried compiling a completely seperate set of sample code and when I did the make in the new code, after the killall SpringBoard both apps showed up


  3. #23
    Newbie Array

    Join Date
    Sep 2008
    Posts
    5
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I think so too.

  4. #24
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    what do you agree with

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. compile webcore on mac
    By mhu in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 08-23-2012, 12:19 AM
  2. Compile iRecovery
    By sailor0703 in forum Tools
    Replies: 1
    Last Post: 09-27-2010, 10:57 PM
  3. UIWebView? Does it compile for you?
    By wififun in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 08-27-2007, 04:07 AM
  4. compile?
    By kdbdallas in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 08-09-2007, 04:02 AM
  5. Compile iphoneinterface on a Mac
    By amb1s1 in forum General
    Replies: 0
    Last Post: 07-10-2007, 02:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 06:26 PM.
twitter, follow us!