[fpc-pascal]Graphics cards, VGALIB

Dr. Rolf Jansen InstantWare at t-online.de
Mon Sep 6 19:15:07 CEST 2004

Sorry, for entering the discussion at this late stage. After reading 
all the follow-ups to Jonas message below, I understood that the 
culprit is still link ordering. If I understood something wrong, then 
please excuse my ignorance.

If not, It might help to add a link parameter (-k...) into the fpc 
command line. How about:

/usr/local/bin/ppcppc MyKillerApplication.pas -k-lsdl 

This should result in an ld command in ppas.sh where the -lsdl 
statement is the very first parameter:

/usr/bin/ld  -lsdl    -L. -o MyKillerApplication `cat link.res`

system.o and allthelocalunits.o files come very late in link.res.

I am not able to check this, but it seems to me that the linker should 
pick the main entry point from the sdllib in this case. I think it 
shouldn´t be to hard for the users of fpc to add appropriate -k... 
parameters to the fpc command line.

Best regards


Am 03.09.2004 um 13:12 schrieb Jonas Maebe:

> On 3 sep 2004, at 11:16, Florian Klaempfl wrote:
>> Can't you add the SDLMain to the darwin sdl units and let this call 
>> main? Or is main defined twice
>> then because the sdllib contains a main?
> Yes. And for some reason, the linker picks the main of our system unit 
> to execute instead of the one in libsdl. I don't know on what basis it 
> does this. The reason it doesn't trigger a duplicate symbol error is 
> that the Mac OS X linker works with a two-level name space: all 
> libraries have their own symbol namespace (although you can disable 
> this for legacy *nix compatibility using an environment variable).
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

More information about the fpc-pascal mailing list