[fpc-devel] Software startup

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Mar 24 10:01:04 CET 2007


Hello,

I am having some trouble with the symbian os port. Basically I am
working with the emulator so far, so consider as if I were writing a
normal (or almost) win32 application.

Basically windows will refuse running the application with a message
saying it´s not a valid win32 application.

To test further, I created a trivial win32 asm app, assembled it with
gas and linked it. Here is the file:

     .file   "prt0.as"
     .text
     /* Entry point for Symbian OS executables */
     .globl E32EXE
E32EXE:
     /* Entry point for MS Windows */
     .globl main
main:
     leave
     ret

And here is how I assemble and link it:

C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32\as.exe prt0.as -o prt0.o
C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32\ld.exe --entry=E32EXE
-o prt0.exe prt0.o

This works fine (ok, the app doesn´t do anything, but also I don´t see
any error messages). by the way, prt0 is just a random name ... don´t
think it has anything to do with the prt0 asm files on fpc

Next I tryed to simply compile the same app, but adding the symbian RTL also:

C:\Programas\lazarus20\fpc\2.0.4\bin\i386-win32\ld.exe --entry=E32EXE
-o prt0.exe prt0.o C:\Programas\fpc21\rtl\units\i386-symbian\system.o
qhelloworld.o

This won´t work. The executable is linked fine, but the app won´t run.
I´m puzzled, because there is absolutely no reference from prt0.o to
system.o or qhelloworld.o, so in fact, only prt0 should be used. Just
by linking together the other .o files makes the .exe problematic.

Any ideas why? system.o is assembled with gnu asm too. I added
qhelloworld.o only because linking system.o alone won´t work, as it
complains about missing things.

And there are no main or E32EXE functions on either system.o or qhelloworld.o

This problem is important because it also occurs when I link a
complete symbian app.

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-devel mailing list