#import <UIKit/UIKit.h>
#define HB_DONT_DEFINE_BOOL
#include <hbapi.h>
#include <hbvm.h>
static NSAutoreleasePool * pool;
HB_FUNC( CREATEPOOL )
{
pool = [ [ NSAutoreleasePool alloc ] init ];
}
HB_FUNC( CREATEAPP )
{
UIApplicationMain( 0, nil, @"MainApp", @"MainApp" );
}
@interface MainApp : UIApplication
{
}
@end
@implementation MainApp
- ( void ) applicationDidFinishLaunching : ( UIApplication * ) application
{
PHB_SYMB symMain = hb_dynsymSymbol( hb_dynsymFindName( "MAIN" ) );
hb_vmPushSymbol( symMain );
hb_vmPushNil();
hb_vmDo( 0 );
exit( 0 );
}
@end
function Main()
? "Hello world from iOS"
return nil
init procedure start
CreatePool()
CreateApp()
return
echo linking...
gcc $1.o ios.o -o $1 -F/usr/include -L./../lib -L./../../harbour/harbour/harbour
/lib/darwin/gcc -lhbdebug -lhbvm -lhbrtl -lhblang -lhbrdd -lgttrm -lgtstd -lhbrt
l -lhbvm -lhbmacro -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbcommon \
-framework CoreFoundation \
-framework Foundation \
-framework UIKit \
-framework CoreGraphics
clear
if [ $# = 0 ]; then
echo syntax: ./build.sh file [options...]
exit
fi
echo compiling...
./../../harbour/bin/harbour $1 -n -I./../../harbour/include $2
if [ $? = 1 ]; then
exit
fi
echo compiling C module...
gcc $1.c -c -I./../../harbour/include
echo linking...
gcc $1.o -o $1 -L./../lib -L./../../harbour/lib -lhbdebug -lhbvm -lhbrtl -lhblang -lhbrdd -lgttrm -lgtstd -lhbrtl -lhbvm -lhbmacro -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbcommon
rm $1.c
rm $1.o
echo done!
iPhone-de-manuel:~/harbour/samples root# gcc -c -I./../../harbour/include -F/usr/include ios.m
In file included from /usr/include/UIKit.framework/Headers/UIResponder.h:10,
from /usr/include/UIKit.framework/Headers/UIView.h:9,
from /usr/include/UIKit.framework/Headers/UIActivityIndicatorView.h:8,
from /usr/include/UIKit.framework/Headers/UIKit.h:11,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIEvent.h:30: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIEvent.h:31: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIView.h:9,
from /usr/include/UIKit.framework/Headers/UIActivityIndicatorView.h:8,
from /usr/include/UIKit.framework/Headers/UIKit.h:11,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIResponder.h:40: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIResponder.h:58: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIResponder.h:59: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIActivityIndicatorView.h:8,
from /usr/include/UIKit.framework/Headers/UIKit.h:11,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIView.h:190: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIView.h:220: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIApplication.h:13,
from /usr/include/UIKit.framework/Headers/UIKit.h:13,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIDevice.h:67: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIDevice.h:68: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIDevice.h:69: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIDevice.h:71: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIDevice.h:72: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIDevice.h:74: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:13,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIApplication.h:161: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:17,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIButton.h:86: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIButton.h:87: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIDocumentInteractionController.h:12,
from /usr/include/UIKit.framework/Headers/UIKit.h:23,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIViewController.h:134: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIViewController.h:135: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIViewController.h:137: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIImagePickerController.h:9,
from /usr/include/UIKit.framework/Headers/UIKit.h:30,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UINavigationController.h:88: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UINavigationController.h:90: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UINavigationController.h:116: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:30,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:60: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:64: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:65: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:68: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:69: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImagePickerController.h:70: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:31,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIImageView.h:23: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImageView.h:26: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIImageView.h:31: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:36,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIMenuController.h:38: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIMenuController.h:40: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:37,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UINavigationBar.h:56: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:46,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIPopoverController.h:114: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIPopoverController.h:118: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:50,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIScreen.h:36: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIScreen.h:37: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:52,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIScrollView.h:159: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UIScrollView.h:196: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:53,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UISearchBar.h:57: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UISearchBar.h:58: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UISearchBar.h:62: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UISearchBar.h:69: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UISearchBar.h:70: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UISearchBar.h:71: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:62,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITabBarController.h:69: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UITableView.h:11,
from /usr/include/UIKit.framework/Headers/UIKit.h:64,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITableViewCell.h:137: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UITableViewCell.h:139: warning: 'weak_import' attribute ignored
/usr/include/UIKit.framework/Headers/UITableViewCell.h:140: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:64,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITableView.h:324: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:66,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITableViewController.h:29: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:71,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITextView.h:88: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:72,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIToolbar.h:45: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:73,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UITouch.h:55: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:77,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIWebView.h:54: warning: 'weak_import' attribute ignored
In file included from /usr/include/UIKit.framework/Headers/UIKit.h:78,
from ios.m:1:
/usr/include/UIKit.framework/Headers/UIWindow.h:60: warning: 'weak_import' attribute ignored
iPhone-de-manuel:~/harbour/samples root#
# ./build.sh
clear
if [ $# = 0 ]; then
echo syntax: ./build.sh file [options...]
exit
fi
echo compiling...
./../../harbour/bin/harbour $1 -n -I./../../harbour/include $2
if [ $? = 1 ]; then
exit
fi
echo compiling C module...
gcc $1.c -c -I./../../harbour/include
echo linking...
gcc $1.o ios.o -o $1 -F/usr/include -L./../lib -L./../../harbour/lib -lhbdebug -lhbvm -lhbrtl -lhblang -lhbrdd -lgttrm -lgtstd -lhbrtl -lhbvm -lhbmacro -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbcommon -framework CoreFoundation -framework Foundation -framework UIKit -framework CoreGraphics
rm $1.c
rm $1.o
echo done!
iPhone-de-manuel:~/harbour/samples root# ./build.sh hello
: command not found:
: command not found:
: command not found: clear
: command not found:
./build.sh: line 65: syntax error near unexpected token `fi'
'/build.sh: line 65: `fi
iPhone-de-manuel:~/harbour/samples root# ./build.sh hello
: command not found:
: command not found:
: command not found: clear
: command not found:
./build.sh: line 65: syntax error near unexpected token `fi'
'/build.sh: line 65: `fi
iPhone-de-manuel:~/harbour/samples root#
compiling...
Harbour 2.1.0beta2 (Rev. 15642)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'hello.prg'...
Lines 12, Functions/Procedures 2
Generating C source output to 'hello.c'... Done.
compiling C module...
linking...
Undefined symbols:
"_HB_FUN_CREATEPOOL", referenced from:
_symbols_table in hello.o
"_HB_FUN_CREATEAPP", referenced from:
_symbols_table in hello.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
done!
iPhone-de-manuel:~/harbour/samples root#
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>CFBundleDisplayName</key>
<string>TabBarSample</string>
<key>CFBundleExecutable</key>
<string>TabBarSample</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.iphone.TabBarSample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>TabBarSample</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
</dict>
</plist>
Return to FiveMac / FivePhone (iPhone, iPad)
Users browsing this forum: No registered users and 1 guest