Page 1 of 2

Firemonkey IOS Application, error on XCODE

Posted: Wed 09 May 2012 14:39
by josecarlos
I am using UNIDAC, and I am starting a new project, a fire monkey HD IOS application. Testing it on windows it works fine, but I got this error message on the XCODE IDE, when I try to build the application.

Compiling /Users/josecarlosdacunhajunior/Desktop/iPad/xcode/../MemDS.pas
MemDS.pas(15,1) Fatal: Syntax error, "UNIT" expected but "INTERFACE" found
Fatal: Compilation aborted
Showing first 200 notices only
Command /bin/sh failed with exit code 1

I am using the latest unidac, Xcode 4.3.2 (IOS 5.1) and XE2 update 4.

I copied all unidac source files to the application folder, maybe this is not the best solution, but Xcode can find the files.


Thanks,
Jose Carlos

Re: Firemonkey IOS Application, error on XCODE

Posted: Wed 09 May 2012 21:06
by josecarlos
I tried again with Xcode 4.2 and IOS 5.0 and same error, this happen when the directive FPC is defined, this is the case on Xcode, it needs to use FPC.

Maybe there is some configuration, but I looked at the unidac help and can't see any relevant info about Firemonkey-IOS.


How to fix this?

Thanks in advance,
Jose Carlos.

Re: Firemonkey IOS Application, error on XCODE

Posted: Thu 10 May 2012 13:55
by AndreyZ
Hello,

Such problem occurs if you add the MemDS unit to the USES clause of some of your units. The point is that there is the MemDS unit in FPC and in order to avoid ambiguous file names, we created the MemDataSet unit. To solve the problem, you should replace MemDS with the following line in the USES clause:

Code: Select all

{$IFDEF FPC}MemDataSet{$ELSE}MemDS{$ENDIF}

Re: Firemonkey IOS Application, error on XCODE

Posted: Thu 10 May 2012 17:52
by josecarlos
Hi Andrey,

Thanks for your reply.



I did what you told me, and the error about memds is solved.

But now I got another one:



Compiling /Users/josecarlosdacunhajunior/Desktop/iPad Unidac/xcode/../FormRomaneio.pas

Compiling /Users/josecarlosdacunhajunior/Desktop/iPad Unidac/xcode/../SQLiteUniProvider.pas

Dac.inc(8,4) Error: Illegal assembler style specified "INTEL"

Compiling /Users/josecarlosdacunhajunior/Desktop/iPad Unidac/xcode/../CRAccess.pas

Dac.inc(8,4) Error: Illegal assembler style specified "INTEL"

Compiling /Users/josecarlosdacunhajunior/Desktop/iPad Unidac/xcode/../CLRClasses.pas

Dac.inc(8,4) Error: Illegal assembler style specified "INTEL"

Compiling /Users/josecarlosdacunhajunior/Desktop/iPad Unidac/xcode/../CRTypes.pas

Dac.inc(8,4) Error: Illegal assembler style specified "INTEL"

CRTypes.pas(140,1) Fatal: There were 4 errors compiling module, stopping

Fatal: Compilation aborted

Re: Firemonkey IOS Application, error on XCODE

Posted: Fri 11 May 2012 07:34
by AndreyZ
Such problems can occur if you are using an incorrect FPC version. The latest UniDAC version 4.1.6 and Delphi XE2 with Update 4 support FPC 2.6.0 . Please perform the steps described in the following article: http://docwiki.embarcadero.com/RADStudi ... up_for_iOS
I've checked this question using RAD Studio XE2 Update 4, UniDAC 4.1.6 , FPC 2.6.0 , and Xcode 4.3 , and there were no problems with compiling an UniDAC-based aplpication.

Re: Firemonkey IOS Application, error on XCODE

Posted: Fri 11 May 2012 12:30
by josecarlos
I am using the latest UniDac 4.1.6 and FPC 2.6.0, the XE2 update 4 Firemonkey installation.

I am compiling all firemonkey demo without problem, and I also bought two components and they are OK.

I reinstall again and the error was still happened.

I reboot my MacBook and it worked. Compiling unidac units was fixed.

So, with the unidac compile fixed, the first test to create a Sqlite database, gives me a memory error.

Reading the unidac help, if the application try to connect to a non existent database, My tests on windows worked fine, it creates the databse, but on xcode running in the iPad simulator I was getting a memory error.

After about ten tries on iPad simulator, I decided to use the iPad device, to see if the error message happen on the real device, so the first try to run on my device the error "Error: Illegal assembler style specified "INTEL"" come back.


Now,I reinstall FPC 2.6.0 and Firemonkey IOS, reboot my macbook and the application is compiling and running on iPad, but it is giving me the error when I try to connect the fisrt time on a database that doesn´t exist ( So I expect that it will be created ).

On more thing, it is working on iPad, but it is giving me the INTEL error on the real devide.


I am using the latest Delphi update 4, Unidac 4.1.6, my macbook is new, nothingelse was installed.

So, I have two problems to solve, the database creation ( I think it should worked that way, if not let me know ).
And this "Error: Illegal assembler style specified "INTEL"" come back.


Thank you for your , and I am looking forward to get this working.

Jose Carlos.

Re: Firemonkey IOS Application, error on XCODE

Posted: Mon 14 May 2012 13:16
by josecarlos
Hi,

I am still trying to figured out what is happening.

All units that have DAC.INC, will give me this "Error: Illegal assembler style specified "INTEL" ", But IOS has ARM proccessor and the DAC.INI have this {$ASMMODE INTEL}, Is this ok?

I also tried the sample code, posted by Dmitry on the firemonley embarcadero forum,
https://forums.embarcadero.com/thread.j ... tstart=300
All units on this sample, don't use DAC.INI, so the building on the xcode works fine.

But, Dimitry's sample raises an error when executed on the iPad Simulator, it raises BAD_ACCESS and stop the execution.


I still think that my FPC and Firemonkey are installed ok, I can build my projects, including the realthinclient to the IOS.

Do you have a working sample, to compare with what I am doing? the Unidac has no IOS sample.

I also try the SQLite3db, that came with FPC, it works fine, I can run on iPad, but Unidac have some features that SQLite3db don´t have, so I would like to use Unidac.


Thanks,
Jose Carlos.

Re: Firemonkey IOS Application, error on XCODE

Posted: Tue 15 May 2012 08:25
by AlexP
Hello,

Try to comment the following line in the DAC.inc file:

{$IFDEF FPC}
{$MODE DELPHI}
// {$ASMMODE INTEL} <-- comment this
{$INTERFACES COM}

Rebuild the application in Xcode and run it on a real iPhone

Re: Firemonkey IOS Application, error on XCODE

Posted: Tue 15 May 2012 12:49
by josecarlos
Hello,

Try to comment the following line in the DAC.inc file:

{$IFDEF FPC}
{$MODE DELPHI}
// {$ASMMODE INTEL} <-- comment this
{$INTERFACES COM}

Rebuild the application in Xcode and run it on a real iPhone
I did this, and I got those errors, Whe I try to build it to a real iPad device:
  • Assembling (pipe) /Users/josecarlosdacunhajunior/Library/Developer/Xcode/DerivedData/AbsolutIPad-fkdfgklijxqabzdpkemlpcjtdfik/Build/Products/Release-iphoneos/AbsolutIPad.app/DAConsts.s
    MemUtils.pas(551,20) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(574,21) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(574,41) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(623,17) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(623,59) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(625,22) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(625,64) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(642,6) Warning: Conversion between ordinals and pointers is not portable
    MemUtils.pas(642,32) Warning: Conversion between ordinals and pointers is not portable
    MemUtils.pas(644,11) Warning: Conversion between ordinals and pointers is not portable
    MemUtils.pas(644,37) Warning: Conversion between ordinals and pointers is not portable
    MemUtils.pas(642,6) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(642,32) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(644,11) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(644,37) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
    MemUtils.pas(991,9) Error: Unrecognized opcode PUSH
    MemUtils.pas(991,17) Error: Assembler syntax error
    MemUtils.pas(992,9) Error: Unrecognized opcode PUSH
    MemUtils.pas(992,17) Error: Assembler syntax error
    MemUtils.pas(993,20) Error: Unknown identifier "ESI"
    MemUtils.pas(994,20) Error: Unknown identifier "EDI"
    MemUtils.pas(995,20) Error: Unknown identifier "ECX"
    MemUtils.pas(995,21) Error: Assembler syntax error in operand
    MemUtils.pas(995,22) Error: Unknown identifier "FFFFFFFFH"
    MemUtils.pas(996,9) Error: Unrecognized opcode XOR
    MemUtils.pas(996,17) Error: Assembler syntax error
    MemUtils.pas(997,9) Error: Unrecognized opcode REPNE
    MemUtils.pas(997,17) Error: Assembler syntax error
    MemUtils.pas(998,9) Error: Unrecognized opcode NOT
    MemUtils.pas(998,17) Error: Assembler syntax error
    MemUtils.pas(999,9) Error: Unrecognized opcode SHL
    MemUtils.pas(999,17) Error: Assembler syntax error
    MemUtils.pas(1000,20) Error: Unknown identifier "EDI"
    MemUtils.pas(1000,21) Error: Unknown identifier "ESI"
    MemUtils.pas(1001,20) Error: Unknown identifier "ESI"
    MemUtils.pas(1002,20) Error: Unknown identifier "EDX"
    MemUtils.pas(1002,21) Error: Unknown identifier "ECX"
    MemUtils.pas(1003,20) Error: Unknown identifier "EAX"
    MemUtils.pas(1003,21) Error: Unknown identifier "EDI"
    MemUtils.pas(1004,9) Error: Unrecognized opcode SHR
    MemUtils.pas(1004,17) Error: Assembler syntax error
    MemUtils.pas(1005,9) Error: Unrecognized opcode REP
    MemUtils.pas(1005,17) Error: Assembler syntax error
    MemUtils.pas(1006,20) Error: Unknown identifier "ECX"
    MemUtils.pas(1006,21) Error: Unknown identifier "EDX"
    MemUtils.pas(1007,20) Error: Unknown identifier "ECX"
    MemUtils.pas(1007,21) Error: Assembler syntax error in operand
    MemUtils.pas(1008,9) Error: Unrecognized opcode REP
    MemUtils.pas(1008,17) Error: Assembler syntax error
    MemUtils.pas(1009,9) Error: Unrecognized opcode POP
    MemUtils.pas(1009,17) Error: Assembler syntax error
    MemUtils.pas(1010,9) Error: Unrecognized opcode POP
    MemUtils.pas(1010,17) Error: Assembler syntax error
    MemUtils.pas(1059,20) Error: Unknown identifier "EDX"
    MemUtils.pas(1059,21) Error: Unknown identifier "EDI"
    MemUtils.pas(1060,20) Error: Unknown identifier "EDI"
    MemUtils.pas(1061,20) Error: Unknown identifier "ECX"
    MemUtils.pas(1061,21) Error: Assembler syntax error in operand
    MemUtils.pas(1061,22) Error: Unknown identifier "FFFFFFFFH"
    MemUtils.pas(1062,9) Error: Unrecognized opcode XOR
    MemUtils.pas(1062,17) Error: Assembler syntax error
    MemUtils.pas(1063,9) Error: Unrecognized opcode REPNE
    MemUtils.pas(1063,17) Error: Assembler syntax error
    MemUtils.pas(1064,20) Error: Unknown identifier "EAX"
    MemUtils.pas(1064,21) Error: Assembler syntax error in operand
    MemUtils.pas(1064,21) Fatal: There were 50 errors compiling module, stopping
    Fatal: Compilation aborted

Running on the iPad simulator it builds fine and running on the simulator, I got BAD ACCESS error when I try to open the sqlite database.



Thanks,

Jose Carlos.

Re: Firemonkey IOS Application, error on XCODE

Posted: Tue 15 May 2012 15:17
by AlexP
hello,

We will investigate the problem with errors occuring when using assembler inserts and we'll inform you as soon as we have any result.

When creating a SQLite DB without specifying the path, i.e.

Code: Select all

UniConnection.DataBase := 'MyDataBase';

, the DB file is created in the root directory of the MacOS file system, perhaps you are lack of rights to create/write to this directory . Try to specify the full path to the directory you have rights for

Re: Firemonkey IOS Application, error on XCODE

Posted: Tue 15 May 2012 17:09
by josecarlos
AlexP wrote:hello,

We will investigate the problem with errors occuring when using assembler inserts and we'll inform you as soon as we have any result.
I am waiting, thanks.
AlexP wrote:hello,
When creating a SQLite DB without specifying the path, i.e.

Code: Select all

UniConnection.DataBase := 'MyDataBase';

, the DB file is created in the root directory of the MacOS file system, perhaps you are lack of rights to create/write to this directory . Try to specify the full path to the directory you have rights for

I am using this code below to put the db file in the documents folder, it worked fine with Sqlite3db.

Code: Select all


    UniConnection1.Database:=  MyFileName;




{$IFDEF FPC}
function MyDirectory : NSString;
var
  paths : NSArray;
  fileName : NSString;
begin
  paths := NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, True);
  fileName := paths.objectAtIndex(0);
  Result := fileName;
end;
{$ENDIF}

function TfrmSincronizaIOS.MyFileName : String;
begin
{$IFDEF FPC}
  Result := String(MyDirectory.UTF8String)+'/Absolut.sqlite';
  {$ELSE}
  Result := Extractfilepath(Paramstr(0)  ) +'Absolut.sqlite';

  {$ENDIF}



The EXC_BAD_ACCESS when I try to connect the database on the iPad Simulator (without the {$ARMMODE INTEL} on DAC.INC ):

Code: Select all

procedure TContextOpenGL.DestroyPixelShader(const Shader: TContextShader);
begin
  if Valid and (Shader <> 0) and MakeCurrent then
    glDeleteShader(Shader);  <== Thread 1:  EXC_BAD_ACCESS (code=2, address=0x0)
 end;


Re: Firemonkey IOS Application, error on XCODE

Posted: Mon 21 May 2012 17:11
by josecarlos
Hi,

I am developing a FM-IOS application using unidac/sqlite with livebindings.

I am testing the app on windows, Can I keep working on it, and when you got it fixed my application will work you an IOS device?



Thanks,



Jose Carlos.

Re: Firemonkey IOS Application, error on XCODE

Posted: Tue 29 May 2012 13:17
by josecarlos
Do you have any news about this issue?

Thanks.

Re: Firemonkey IOS Application, error on XCODE

Posted: Thu 07 Jun 2012 02:01
by acyrluiz
I am trying to use a UNIDAC with the Firemonkey to build application for IOS and when i build the xcode project show the mensage error that can't find unit Uni.
How can i fix this error?
I download the trial version to test this product in IOS.

Re: Firemonkey IOS Application, error on XCODE

Posted: Thu 07 Jun 2012 07:03
by AlexP
hello,

After you have exported your application to XCode (using the DPR2XCODE.EXE utility). You should place all our *.ppu and *.o files to the created XCode folder, after that you can compile and build your application for iOS by means of XCode