Anyone got a clue on this?
On 10/3/05 10:50 AM Brian Hammond wrote:
Hello -
This is my first time using Inline.
I am trying to autowrap a C library called GLFW using Inline C (0.44) on
Mac OS X. GLFW is a very nice cross-platform OpenGL Framework. It
deals with the system issues and gets out of the way of your OpenGL
app. Once I get this working I plan on wrapping a few other libraries
and making a decent framework for developing games in Perl (ala PyGame
for Python, but for 3D).
GLFW is built as a static library (libglfw.a) and is installed in the
usual location (/usr/local/lib). GCC finds it without issue. I am
having an issue however. To use OpenGL on Mac OS X "natively" (read:
not through X11), one must link using the -framework OpenGL option to
GCC. You'll also end up needing -framework AGL (Apple OpenGL) and
-framework Carbon (GLFW uses Carbon on Mac OS X).
So I have GLFW.pm at the moment compiling fine but failing to find
certain symbols that I find strange:
ld: Undefined symbols:
_main
_Perl_Gthr_key_ptr
_Perl_Isv_yes_ptr
_Perl_Tcurpad_ptr
_Perl_Tmarkstack_ptr_ptr
<snip>
Note that I have to use LDDLFLAGS for the -framework options and not
LIBS as I get "unknown option to LIBS: -framework" otherwise.
To make this easy for someone to help me, here's how to set this all up:
* Download and install GLFW on Mac OS X 10.3 (I am running 10.3.9)
http://easynews.dl.sourceforge.net/sourceforge/glfw/glfw-2.5.0.tar.bz2
make macosx-gcc
sudo mkdir -p /usr/local/lib
sudo cp libglfw.a /usr/local/lib
sudo ranlib /usr/local/lib/libglfw.a
sudo mkdir -p /usr/local/include/GL
sudo cp glfw.h /usr/local/include/GL
* Download my script (didn't want to make this email *too* big):
http://brianhammond.com/perl/GLFW.pm
http://brianhammond.com/perl/glfw-test.pl
* Try my script
perl -MInline=FORCE,NOISY ./glfw-test.pl
Let me know if you have any insights on this!
Thanks, Brian H.
PS - I'm not sure it matters but I am using Fink's perl in /sw/bin/perl
which is Perl 5.8.6
$ which perl
/sw/bin/perl
$ perl -v
This is perl, v5.8.6 built for darwin-thread-multi-2level