after some googleing and errors i managed to build with my following makefile (only for osx, luarocks doesnt build LuaGL because it doesnt give the -frameworks parameters to gcc)
But i still get some memory runtime errors
CC = export MACOSX_DEPLOYMENT_TARGET=10.3;gcc
LD = export MACOSX_DEPLOYMENT_TARGET=10.3;gcc
FrameWorks = -F/System/Library/Frameworks/
INC = -I/usr/include/ -I/usr/local/include/ $(FrameWorks) -Iinclude
LIB = $(FrameWorks) -framework OpenGL -framework GLUT -L/usr/lib/ -lgmalloc -L/usr/local/lib/ -llua5.1
CFLAGS = -pedantic -fno-common -Wall -fPIC $(INC)
LFLAGS = $(LIB) -bundle -undefined dynamic_lookup -all_load
all: LibGL LibGlut
clean:
rm *.o *.so
%.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@
LibGL: LuaGL.o
$(LD) $(LFLAGS) -o luagl.so LuaGL.o
LibGlut: LuaGlut.o
$(LD) $(LFLAGS) -o luaglut.so LuaGlut.o
[[/code]]
In the file luagl.c says:
it doesnt work in mac osx (because doesnt come with it), its better to change it to:
that seems to be the main problem at runtime because it keeps telling me the following error:
lua(19956,0xa000ed88) malloc: *** Deallocation of a pointer not malloced: 0x84c28;
anyone has an idea?