Closed GoogleCodeExporter closed 8 years ago
On Fedora 13, I had a similar problem.
ffi.h is in /usr/lib/libffi-3.0.9/include/,
and (if my memory serves) is installed with the libffi-devel-3.0.9 package.
Also I needed to modify Makefile:
% svn diff
Index: Makefile
===================================================================
--- Makefile (revision 3522)
+++ Makefile (working copy)
@@ -45,7 +45,7 @@
# options, respectively. LIBS is to be used for additional libraries to be
# linked (-l etc.).
-CFLAGS = -g -O2
+CFLAGS = -g -O2 -I/usr/lib/libffi-3.0.9/include
FLAGS = $(CPPFLAGS) $(CFLAGS) $(PIC) $(LDFLAGS)
%
Original comment by echochamber
on 26 Jul 2010 at 5:47
Yes, the ffi.h file comes from libffi, not pure-ffi, so you need to make sure
that libffi is installed before compiling pure-ffi.
There's no need to change the Makefile, though. Just set CPPFLAGS to the needed
include flags, that's what it's for. Similarly, you might have to set LDFLAGS
to the linker flags needed to get libffi.a/dylib. E.g.:
make CPPFLAGS=-I/somewhere/include LDFLAGS=-L/somewhere/lib
You have to look for ffi.h and libffi.* to see where they are installed. That
depends on whether you installed libffi by hand, using Fink or MacPorts, etc.
> Was attempting to build pure-gl, the README does not mention a dependency on
ffi.
pure-gl by itself doesn't need ffi, why should it?
> pure-gl is missing an empty definition of APIENTRY on Mac OS X.
No, it's right there, at the beginning of every C file:
#ifndef _WIN32
#define APIENTRY
#endif
Have you tried using pure-gl from MacPorts? In any case this is a separate
issue, and it's better to post about this on the mailing list. Ryan Schmidt
(the author of the Pure-related ports in MacPorts) might be able to help you
there.
BTW, pure-ffi is available in MacPorts as well. I think that most Pure-related
packages are already in MacPorts (along with the requisite dependencies), so
that should be the easiest way to go if you're running any of the supported OSX
versions.
Original comment by aggraef@gmail.com
on 26 Jul 2010 at 8:13
Thanks, that solves it. It would be nice if the README files mentioned the
prerequisites: libffi for pure-ffi and pure-ffi for the pure-gl examples. I'm
not using MacPorts because it is opaque and difficult to uninstall. I will try
to debug why XCode reported undefined APIENTRY and report my findings if any on
the mailing list.
Original comment by autoteli...@gmail.com
on 26 Jul 2010 at 3:57
This is a bit unusual but the post to the mailing list on the 26th has not
showed up yet, so to close this off here is the result:
System: Mac OS X 10.6.4, XCode 3.2.2 64-bit, gcc 4.2.1
In the the pure-gl GL*.c files APIENTRY is for non-windows systems defined at
the beginning of each file.
After inclusion of glut.h the symbol is no longer defined because in glut.h:
...
#if !defined(_WIN32)
#define APIENTRY
#define GLUT_APIENTRY_DEFINED
#define CALLBACK
#endif
...
#ifdef GLUT_APIENTRY_DEFINED
# undef GLUT_APIENTRY_DEFINED
# undef APIENTRY
#endif
...
So redefining APIENTRY after the inclusion of glut.h is required to compile
pure-gl with this version of glut on Mac OS X (I did not find a version number
in the header files, so it is unclear to me which version of glut it really is
that is included in the Apple tools).
[Add: comparing glut.h files it seems the latest is 3.7.6 from 2001 which is
the one used in Mac OS X. Freeglut does not use the same defines, which may
explain why it is not a problem on Linux.]
Original comment by autoteli...@gmail.com
on 1 Aug 2010 at 10:01
Yeah, the libffi dependency is mentioned but maybe it's not clear enough. I'll
fix up the README files accordingly.
I've moved the APIENTRY stuff to the new issue #45, as it's really a separate
issue.
Original comment by aggraef@gmail.com
on 2 Aug 2010 at 6:38
Original issue reported on code.google.com by
autoteli...@gmail.com
on 25 Jul 2010 at 10:09