Compiling
Started by: Anonymous (85.228.127.x)
On: 1199977273|%e %b %Y, %H:%M %Z|agohover
Number of posts: 8
rss icon RSS: New posts
Compiling
Anonymous (85.228.127.x) 1199977273|%e %b %Y, %H:%M %Z|agohover

I have no idea where to start, since there are no tutorials or anything. :( Or maybe this is a dead project?

unfold Compiling by Anonymous (85.228.127.x), 1199977273|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
fabiowguerrafabiowguerra 1200024621|%e %b %Y, %H:%M %Z|agohover

It is not a dead project, since there are big changes on the svn. But it really needs a better documentation and makefile to be more usefull to a lot of people.

Fabio

unfold Re: Compiling by fabiowguerrafabiowguerra, 1200024621|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
Anonymous (150.101.122.x) 1200192119|%e %b %Y, %H:%M %Z|agohover

Any news on this? If there's no Makefile can anybody give me a bit of a hint for compiling with gcc on OS X?

Cheers,
Scott

unfold Re: Compiling by Anonymous (150.101.122.x), 1200192119|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
fabiowguerrafabiowguerra 1200284224|%e %b %Y, %H:%M %Z|agohover

Hi Scott,

I do not have experience with OS X.

But if you are just extending an OpenGL application, you can simply include LuaGL.c in your project and add LuaGL headers to your include path, that should work.

If you need to use glut, you can create a dynamic library, linking LuaGL.c and LuaGlut.c (and LuaGlu.c and LuaGLAux.c, if using the SVN version). The dependencies are on Lua, OpenGL, GLU and GLUT.

I'm using the following makefile on linux, but I think it is not very portable. I'm accepting suggestion on how to build a more portable makefile…

CC = gcc
LD = ld
INC = -Iinclude -Isrc -I/usr/include/lua5.1
LIB = -lGLU -lGL -lm -llua5.1
CFLAGS = -Wall -fPIC -c $(INC)
LFLAGS = $(LIB)
LGLUT = -lglut

all: luagl luaglu luaglut

luagl: LibLuaGL
luaglu: LibLuaGlu
luaglut: LibLuaGlut

clean:
rm *.o *.so

LuaGLAux.o: src/LuaGLAux.c
$(CC) $^ $(CFLAGS) -o $@

LuaGL.o: src/LuaGL.c
$(CC) $^ $(CFLAGS) -o $@

LuaGlu.o: src/LuaGlu.c
$(CC) $^ $(CFLAGS) -o $@

LuaGlut.o: src/LuaGlut.c
$(CC) $^ $(CFLAGS) -o $@

LibLuaGL: LuaGL.o LuaGLAux.o
$(LD) $(LFLAGS) -shared -o LuaGL.so LuaGL.o LuaGLAux.o

LibLuaGlu: LuaGlu.o LuaGLAux.o
$(LD) $(LFLAGS) -shared -o LuaGlu.so LuaGlu.o LuaGLAux.o

LibLuaGlut: LuaGlut.o
$(LD) $(LFLAGS) $(LGLUT) -shared -o LuaGlut.so LuaGlut.o

Hope this helped you.

Fabio

unfold Re: Compiling by fabiowguerrafabiowguerra, 1200284224|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
Anonymous (96.246.68.x) 1223782433|%e %b %Y, %H:%M %Z|agohover

Hi, it's funny because it's been so long since I've used this. I never did see your reply :)

Thanks for the info. I did end up getting it to work.

Cheers

unfold Re: Compiling by Anonymous (96.246.68.x), 1223782433|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
alvaro martínez (guest) 1232788113|%e %b %Y, %H:%M %Z|agohover

could you post the makefile?
i am also a os x user, but this doesn't compile via luarocks

unfold Re: Compiling by alvaro martínez (guest), 1232788113|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
alvaro martínez (guest) 1233373509|%e %b %Y, %H:%M %Z|agohover

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:

#include <malloc.h>

it doesnt work in mac osx (because doesnt come with it), its better to change it to:

#include <stdio.h>

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?

unfold Re: Compiling by alvaro martínez (guest), 1233373509|%e %b %Y, %H:%M %Z|agohover
Re: Compiling
George PetsagourakisGeorge Petsagourakis 1233400339|%e %b %Y, %H:%M %Z|agohover

Good to see somebody hasn't given up on this.
Now all I am waiting for is a new version getting support for OpenGL 3.0 :)

unfold Re: Compiling by George PetsagourakisGeorge Petsagourakis, 1233400339|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.