Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-08

Help needed with (JEDI-)SDL on Mac OS X with FPC 2.0.4 powerpc

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tom Verhoeff

I try to compile a little demo program for SDL, but it still fails.

I use fpc 2.0.4 on powerpc Mac OS X with sdl 1.2.7 installed through fink (also tried it with SDL installed in /Library/Frameworks).

I consulted the wiki <http://wiki.freepascal.org/index.php/FPC_and_SDL> and <http://userpage.fu-berlin.de/~molski/fpsdl/>.

The problem is in the linking phase (compile and assemble are OK). It gives me some warnings like

/usr/bin/ld: warning suggest use of -bind_at_load, as lazy binding may result in errors or different symbols being used
symbol _acosl used from dynamic library /usr/lib/libstdc++.6.dylib(single module ) not from earlier dynamic library /usr/lib/libSystem.B.dylib(ld64.o)

but what is worse it stops at

_HIPointConvert referenced from QuickTime expected to be defined in Carbon demo02.pp(114,1) Error: Error while linking
Error: /usr/local/bin/ppcppc returned an error exitcode (normal if you did not s pecify a source file to be compiled)

Any idea what I messed up?

This is what my command line looks like:

fpc -Fu/Users/wstomv/Download/JEDI-SDLv1.0/SDL/Pas -Fl/usr/X11R6/lib -XMSDL_main -k-L/sw/lib -k-lSDL -k-framework -kOpenGL -k-framework -kCocoa -Mdelphi demo02

The program demo2.pp contains

{$linklib gcc}
{$linklib SDLmain}
Uses SDL, crt;

This program was grabbed from <http://userpage.fu-berlin.de/~molski/fpsdl/> and then adapted according to <http://wiki.freepascal.org/index.php/FPC_and_SDL>

Your advice would be greatly appreciated,

Tom

E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science PHONE: +31 40 247 41 25 | Technische Universiteit Eindhoven FAX: +31 40 247 54 04 | PO Box 513, NL-5600 MB Eindhoven http://www.win.tue.nl/~wstomv/ | The Netherlands
Milan Marusinec
to Tom Verhoeff
Tom Verhoeff wrote 5 lines
Any idea what I messed up? This is what my command line looks like: fpc -Fu/Users/wstomv/Download/JEDI-SDLv1.0/SDL/Pas -Fl/usr/X11R6/lib -XMSDL_main -k-L/sw/lib -k-lSDL -k-framework -kOpenGL -k-framework -kCocoa -Mdelphi demo02

I would suggest to pass the -k switch this way:

-k"-framework Carbon -framework Cocoa -framework OpenGL -lSDL -L/sw/lib"

because, fpc passes the "whole content of -k switch" to ld.

This way it already worked for me in one of my projects.

Milano

Tom Verhoeff
to Milan Marusinec
Milan Marusinec wrote 14 lines
Tom Verhoeff wrote: >Any idea what I messed up? > >This is what my command line looks like: > >fpc -Fu/Users/wstomv/Download/JEDI-SDLv1.0/SDL/Pas -Fl/usr/X11R6/lib >-XMSDL_main -k-L/sw/lib -k-lSDL -k-framework -kOpenGL -k-framework -kCocoa >-Mdelphi demo02 I would suggest to pass the -k switch this way: -k"-framework Carbon -framework Cocoa -framework OpenGL -lSDL -L/sw/lib" because, fpc passes the "whole content of -k switch" to ld.

I tried that, but it didn't work. Maybe shell-dependent; I use /bin/bash on Mac OS X 10.3.9.

This way it already worked for me in one of my projects.

I notice that you also include -framework Carbon, so I tried that as well. But it did not help a bit.

Could it be related to versions of the various libraries? E.g., it may require 10.4.x.

Still, I would like to know what is the matter.

Thanks for further advice,

Tom

E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science PHONE: +31 40 247 41 25 | Technische Universiteit Eindhoven FAX: +31 40 247 54 04 | PO Box 513, NL-5600 MB Eindhoven http://www.win.tue.nl/~wstomv/ | The Netherlands
Jonas Maebe
to Tom Verhoeff
Tom Verhoeff wrote 20 lines
On Fri, Aug 17, 2007 at 10:47:27PM +0100, Milan Marusinec wrote: > Tom Verhoeff wrote: >> Any idea what I messed up? >> >> This is what my command line looks like: >> >> fpc -Fu/Users/wstomv/Download/JEDI-SDLv1.0/SDL/Pas -Fl/usr/X11R6/lib >> -XMSDL_main -k-L/sw/lib -k-lSDL -k-framework -kOpenGL -k- >> framework -kCocoa >> -Mdelphi demo02 > > I would suggest to pass the -k switch this way: > > -k"-framework Carbon -framework Cocoa -framework OpenGL -lSDL -L/ > sw/lib" > > because, fpc passes the "whole content of -k switch" to ld. I tried that, but it didn't work. Maybe shell-dependent; I use /bin/bash on Mac OS X 10.3.9.

No, it's a bug in current FPC releases. It will be fixed in the next release. You can also work around it with current releases by directly calling ppcppc/ppc386 instead of fpc.

Could it be related to versions of the various libraries? E.g., it may require 10.4.x.

Yes: http://www.idevgames.com/forum/showthread.php?p=130497

http://www.google.com/search?q=_HIPointConvert+referenced+from+QuickTime

Jonas