Page 1 of 2

Usando el simulador del iPhone/iPad

Posted: Mon Nov 08, 2010 5:59 pm
by Antonio Linares
He añadido en samples buildsim.sh cuyo objetivo es construir una aplicación para ejecutarla en el simulador! :-)

Llego hasta este error:

compiling...
Harbour 2.1.0beta1 (Rev. 14766)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'tutor02.prg'...
Lines 62, Functions/Procedures 1
Generating C source output to 'tutor02.c'... Done.
compiling C module...
linking...
ld: library not found for -lcrt1.10.6.o

A ver si lo solucionamos :-)

Re: Usando el simulador del iPhone/iPad

Posted: Tue Nov 09, 2010 9:50 am
by Antonio Linares
Aqui he encontrado la forma de solucionarlo:
http://vonluck.wordpress.com/2009/09/16 ... ng-errors/
If you’re having libcrt linker errors, similar to:

ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
This can be solved by creating a sym link from crt1.10.5.o to crt1.10.6.o:

MacMini-2:lib johannes$ pwd
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/lib
MacMini-2:lib johannes$ sudo ln -s crt1.10.5.o crt1.10.6.o
MacMini-2:lib johannes$ ls -la *crt*
-rw-r--r-- 1 root wheel 17324 Dec 22 2007 crt1.10.5.o
lrwxr-xr-x 1 root wheel 11 Sep 15 19:38 crt1.10.6.o -> crt1.10.5.o
-rw-r--r-- 1 root wheel 18212 Dec 22 2007 crt1.o
-rw-r--r-- 1 root wheel 18472 Dec 22 2007 gcrt1.o
En concreto he hecho:

Code: Select all

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib
sudo ln -s crt1.10.5.o crt1.10.6.o
 
seguimos avanzando... :-)

Re: Usando el simulador del iPhone/iPad

Posted: Tue Nov 09, 2010 9:52 am
by Antonio Linares
Ahora no podemos usar las librerias de Harbour para el iPhone/iPad pues son de arquitectura ARM.

Asi que hay que probar si podemos usar las de Mac, o hay que construir Harbour con las librerias del iPhone simulator SDK, arquitectura i386.

Re: Usando el simulador del iPhone/iPad

Posted: Tue Nov 09, 2010 11:30 am
by Antonio Linares
Viktor me ha indicado los flags a usar para forzar la creación en arquitectura i386 (ya que Snow Leopard es 64 bits):

export HB_USER_CFLAGS="-arch i386"
export HB_USER_DFLAGS="-arch i386"
export HB_USER_LDFLAGS="-arch i386"

make

construyendo...

Editado: Hay un momento en que libtool da un error y hay que volver a hacer:
export HB_USER_DFLAGS="-arch_only i386"

Re: Usando el simulador del iPhone/iPad

Posted: Tue Nov 09, 2010 12:26 pm
by Antonio Linares
https://trac.pjsip.org/repos/wiki/Getti ... ted/iPhone
If you get this error during compilation:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/available.h:111:6:
error: #error __MAC_OS_X_VERSION_MAX_ALLOWED must be >= __MAC_OS_X_VERSION_MIN_REQUIRED
Add this in your config_site.h:

#undef __MAC_OS_X_VERSION_MIN_REQUIRED
#undef __MAC_OS_X_VERSION_MAX_ALLOWED
#define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_OS_X_VERSION_10_4
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_OS_X_VERSION_10_5

Re: Usando el simulador del iPhone/iPad

Posted: Wed Nov 10, 2010 11:24 am
by mastintin
Lo has conseguido hacer funcionar ? ...
El harbour a usar es el de mac , pero con librerias a 32bits. ¿no? . Las tienes generadas ya ?

Re: Usando el simulador del iPhone/iPad

Posted: Wed Nov 10, 2010 12:08 pm
by Antonio Linares
Manuel,

He conseguido construir las librerias en 32 bits de Harbour para el simulador, pero aún estoy con el error anterior cuando intento compilar los ficheros de nuestra carpeta sdkapi, no he conseguido resolverlo de momento:
from source/sdkapi/accels.m:1:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/available.h:111:6: error: #error __MAC_OS_X_VERSION_MAX_ALLOWED must be >= __MAC_OS_X_VERSION_MIN_REQUIRED

Re: Usando el simulador del iPhone/iPad

Posted: Wed Nov 10, 2010 4:42 pm
by mastintin
He estado investigando un poco y según lo que yo entiendo en el archivo
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/available.h .
se debe de colocar al principio del archivo :

#undef __MAC_OS_X_VERSION_MIN_REQUIRED
#undef __MAC_OS_X_VERSION_MAX_ALLOWED
#define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_OS_X_VERSION_10_4
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_OS_X_VERSION_10_5

para que luego trage el resto ¿ no ? .
saludos.

Re: Usando el simulador del iPhone/iPad

Posted: Wed Nov 10, 2010 4:48 pm
by Antonio Linares
Manuel,

Yo lo que he intentado es copiar esas líneas al comienzo del fichero accels.m cambiando __MAC_OS_X_VERSION_10_4 y __MAC_OS_X_VERSION_10_5 por sus valores, pero me sigue dando el error.

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 12:21 pm
by mastintin
Antonio me puedes mandar el harbour 32bits ? a ver si yo tambien puedo intentarlo ...
Saludos.

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 1:10 pm
by Antonio Linares
Manuel,

Estas son las librerias de 32 bits de Harbour para Darwin:
http://www.mediafire.com/?9u9bz22c1up86c5

A ver si conseguimos compilar accels.m

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 2:27 pm
by mastintin
antonio encontré esto que puede darnos idea por donde van los tiros ...http://lists.apple.com/archives/xcode-u ... 00399.html

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 2:51 pm
by mastintin
Antonio se me ocurrió una idea ... he abierto el xcode y he creado un nuevo proyecto de libreria estatica para iphone , he pasado el accels.m al proyecto y he dado a crear . Evidentemente me esperaba el resultado lleno de errores ,pero lo que quería ver era los flags que usaba xcode parta compilar ... El resultado es este : ( veo unos flags para versiones minimas y demas )

Code: Select all

Build yo of project yo with configuration Debug

ProcessPCH /var/folders/wE/wE6OSd9oFl06xlrtz76lp++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/yo_Prefix-exqxrhmtmbssonanctnfxetmwtih/yo_Prefix.pch.gch yo_Prefix.pch normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Developer/proyectos/iphone/yo
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -fexceptions -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -iquote /Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-generated-files.hmap -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-own-target-headers.hmap -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-all-target-headers.hmap -iquote /Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-project-headers.hmap -F/Developer/proyectos/iphone/yo/build/Debug-iphonesimulator -I/Developer/proyectos/iphone/yo/build/Debug-iphonesimulator/include -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/DerivedSources/i386 -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/DerivedSources -c /Developer/proyectos/iphone/yo/yo_Prefix.pch -o /var/folders/wE/wE6OSd9oFl06xlrtz76lp++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/yo_Prefix-exqxrhmtmbssonanctnfxetmwtih/yo_Prefix.pch.gch

CompileC build/yo.build/Debug-iphonesimulator/yo.build/Objects-normal/i386/accels.o /Users/manuel/Desktop/parasimul/fivephone/source/sdkapi/accels.m normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Developer/proyectos/iphone/yo
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -fexceptions -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -iquote /Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-generated-files.hmap -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-own-target-headers.hmap -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-all-target-headers.hmap -iquote /Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/yo-project-headers.hmap -F/Developer/proyectos/iphone/yo/build/Debug-iphonesimulator -I/Developer/proyectos/iphone/yo/build/Debug-iphonesimulator/include -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/DerivedSources/i386 -I/Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/DerivedSources -include /var/folders/wE/wE6OSd9oFl06xlrtz76lp++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/yo_Prefix-exqxrhmtmbssonanctnfxetmwtih/yo_Prefix.pch -c /Users/manuel/Desktop/parasimul/fivephone/source/sdkapi/accels.m -o /Developer/proyectos/iphone/yo/build/yo.build/Debug-iphonesimulator/yo.build/Objects-normal/i386/accels.o


 

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 4:27 pm
by Antonio Linares
Manuel,

Gracias!!! Ha compilado perfectamente con:

CFLAGS = -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -mthumb -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk

Lo subo dentro del makefile al repositorio :-D

Re: Usando el simulador del iPhone/iPad

Posted: Thu Nov 11, 2010 4:35 pm
by Antonio Linares
Ahora no encuentra las Clases del UIKit. Algo se nos está pasando por alto...
Harbour 2.1.0beta1 (Rev. 14766)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'tutor02.prg'...
Lines 62, Functions/Procedures 1
Generating C source output to 'tutor02.c'... Done.
compiling C module...
linking...
Undefined symbols:
".objc_class_name_NSAutoreleasePool", referenced from:
literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libfivec.a(uikit.o)
".objc_class_name_NSRunLoop", referenced from:
literal-pointer@__OBJC@__cls_refs@NSRunLoop in libfivec.a(msgs.o)
"___bzero", referenced from:
_hb_stackInit in libhbvm.a(hvmall.o)
_hb_objDestructorCall in libhbvm.a(hvmall.o)
_hb_clsNew in libhbvm.a(hvmall.o)
_hb_dynsymToNum in libhbvm.a(hvmall.o)
_hb_stackGetTSD in libhbvm.a(hvmall.o)
_hb_stackGetTSD in libhbvm.a(hvmall.o)
_hb_clsAllocMsg in libhbvm.a(hvmall.o)
_hb_clsDictInit in libhbvm.a(hvmall.o)
_hb_rddNewAreaNode in libhbrdd.a(wafunc.o)
_hb_rddNewAreaNode in libhbrdd.a(wafunc.o)
_hb_rddNewAreaNode in libhbrdd.a(wafunc.o)
_hb_cdpBuildTransTable in libhbrtl.a(cdpapi.o)
_hb_cdpFindPos in libhbrtl.a(cdpapi.o)
_hb_cdpRegisterNew in libhbrtl.a(cdpapi.o)
_hb_gtLoad in libhbrtl.a(hbgtcore.o)
_hb_gtLoad in libhbrtl.a(hbgtcore.o)
_hb_gt_def_New in libhbrtl.a(hbgtcore.o)
_hb_gt_def_Resize in libhbrtl.a(hbgtcore.o)
_hb_gt_def_Resize in libhbrtl.a(hbgtcore.o)
_hb_gt_def_StringToColors in libhbrtl.a(hbgtcore.o)
_va_arg_get in libhbcommon.a(hbprintf.o)
_va_arg_get in libhbcommon.a(hbprintf.o)
_hb_waNodeInsert in libhbrdd.a(wacore.o)
_hb_waNodeInsert in libhbrdd.a(wacore.o)
_hb_waNodeInsert in libhbrdd.a(wacore.o)
_hb_rddRegister in libhbrdd.a(workarea.o)
_hb_waSetFieldExtent in libhbrdd.a(workarea.o)
_hb_fsFindFirst in libhbcommon.a(hbffind.o)
_hb_fsFindFirst in libhbcommon.a(hbffind.o)
_hb_dbfSetFieldExtent in libhbrdd.a(dbf1.o)
_hb_dbfCreate in libhbrdd.a(dbf1.o)
_hb_dbfCreate in libhbrdd.a(dbf1.o)
_hb_dbfOpen in libhbrdd.a(dbf1.o)
_hb_dbfOpen in libhbrdd.a(dbf1.o)
_hb_dbfPasswordSet in libhbrdd.a(dbf1.o)
_hb_dbfSetBlankRecord in libhbrdd.a(dbf1.o)
_hb_gt_trm_Init in libgttrm.a(gttrm.o)
_hb_gt_trm_SetDispTrans in libgttrm.a(gttrm.o)
_hb_gt_trm_SetDispTrans in libgttrm.a(gttrm.o)
_hb_fptCreateMemFile in librddfpt.a(dbffpt1.o)
_hb_fptCreateMemFile in librddfpt.a(dbffpt1.o)
_hb_fptOpenMemFile in librddfpt.a(dbffpt1.o)
_hb_fptWriteMemo in librddfpt.a(dbffpt1.o)
_hb_fptWriteMemo in librddfpt.a(dbffpt1.o)
_hb_fptWriteMemo in librddfpt.a(dbffpt1.o)
_hb_ntxOrderCreate in librddntx.a(dbfntx1.o)
_hb_ntxTagHeaderSave in librddntx.a(dbfntx1.o)
_hb_ntxIndexTagAdd in librddntx.a(dbfntx1.o)
_hb_ntxPageGetBuffer in librddntx.a(dbfntx1.o)
_hb_ntxKeyPutItem in librddntx.a(dbfntx1.o)
_hb_ntxKeyPutItem in librddntx.a(dbfntx1.o)
_hb_ntxKeyPutItem in librddntx.a(dbfntx1.o)
_hb_ntxTagNew in librddntx.a(dbfntx1.o)
_hb_ntxTagCreate in librddntx.a(dbfntx1.o)
_hb_ntxTagCreate in librddntx.a(dbfntx1.o)
__hb_sxGetKey in libhbsix.a(sxcrypt.o)
_hb_fileInsertLock in libhbrtl.a(filebuf.o)
".objc_class_name_UIWindow", referenced from:
.objc_class_name_Window in libfivec.a(windows.o)
".objc_class_name_NSBundle", referenced from:
literal-pointer@__OBJC@__cls_refs@NSBundle in libfivec.a(msgs.o)
literal-pointer@__OBJC@__cls_refs@NSBundle in libfivec.a(nibs.o)
literal-pointer@__OBJC@__cls_refs@NSBundle in libfivec.a(system.o)
".objc_class_name_UIFont", referenced from:
literal-pointer@__OBJC@__cls_refs@UIFont in libfivec.a(labels.o)
".objc_class_name_UIColor", referenced from:
literal-pointer@__OBJC@__cls_refs@UIColor in libfivec.a(windows.o)
literal-pointer@__OBJC@__cls_refs@UIColor in libfivec.a(labels.o)
literal-pointer@__OBJC@__cls_refs@UIColor in libfivec.a(views.o)
".objc_class_name_UIApplication", referenced from:
literal-pointer@__OBJC@__cls_refs@UIApplication in libfivec.a(msgs.o)
literal-pointer@__OBJC@__cls_refs@UIApplication in libfivec.a(system.o)
.objc_class_name_MainApp in libfivec.a(mainapp.o)
".objc_class_name_UIDevice", referenced from:
literal-pointer@__OBJC@__cls_refs@UIDevice in libfivec.a(msgs.o)
literal-pointer@__OBJC@__cls_refs@UIDevice in libfivec.a(system.o)
".objc_class_name_UIImageView", referenced from:
literal-pointer@__OBJC@__cls_refs@UIImageView in libfivec.a(msgs.o)
"_fopen$UNIX2003", referenced from:
_hb_fopen in libhbcommon.a(hbfopen.o)
".objc_class_name_UIView", referenced from:
literal-pointer@__OBJC@__cls_refs@UIView in libfivec.a(windows.o)
.objc_class_name_View in libfivec.a(views.o)
".objc_class_name_UIActivityIndicatorView", referenced from:
literal-pointer@__OBJC@__cls_refs@UIActivityIndicatorView in libfivec.a(msgs.o)
".objc_class_name_UIScreen", referenced from:
literal-pointer@__OBJC@__cls_refs@UIScreen in libfivec.a(windows.o)
literal-pointer@__OBJC@__cls_refs@UIScreen in libfivec.a(system.o)
".objc_class_name_NSURL", referenced from:
literal-pointer@__OBJC@__cls_refs@NSURL in libfivec.a(msgs.o)
".objc_class_name_UIImage", referenced from:
literal-pointer@__OBJC@__cls_refs@UIImage in libfivec.a(msgs.o)
literal-pointer@__OBJC@__cls_refs@UIImage in libfivec.a(views.o)
".objc_class_name_UIAlertView", referenced from:
literal-pointer@__OBJC@__cls_refs@UIAlertView in libfivec.a(msgs.o)
.objc_class_name_MyUIAlertViewDelegate in libfivec.a(msgs.o)
".objc_class_name_UILabel", referenced from:
literal-pointer@__OBJC@__cls_refs@UILabel in libfivec.a(labels.o)
".objc_class_name_NSString", referenced from:
literal-pointer@__OBJC@__cls_refs@NSString in libfivec.a(msgs.o)
literal-pointer@__OBJC@__cls_refs@NSString in libfivec.a(labels.o)
literal-pointer@__OBJC@__cls_refs@NSString in libfivec.a(views.o)
literal-pointer@__OBJC@__cls_refs@NSString in libfivec.a(fwprototypes.o)
ld: symbol(s) not found