lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2009/4/29 Timothy McDowell <tmcdowell@gmail.com>:
> Ok, Sorry about the multiple posts...
> I fixed what looked like messed up paths (../../../tolua/include to the
> actual tolua path ._.).
> Now, I get:
> gcc -c SDL_tolua.c -I../tolua-5.1b/include -I/opt/local/include
> SDL_tolua.c:1475: error: redefinition of ‘tolua_get_SDL_type’
> SDL_tolua.c:1400: error: previous definition of ‘tolua_get_SDL_type’ was
> here
> ...

I managed to compile luaSDL yesterday using tolua++ instead of tolua
(there was no reason other than that was what was available as a
package on my distro), you might want to try that instead. My
SDL_tolua.c doesn't have those definitions your compiler is
complaining about.

I made the following changes to the makefile to make it compile. (this
assumes that tolua and lua are installed in the normal system
directories, so you might have to change it)

    Henk

--- luaSDL.orig/Makefile	2002-11-19 23:15:35.000000000 -0500
+++ luaSDL/Makefile	2009-04-28 19:40:50.000000000 -0400
@@ -5,21 +5,21 @@

 include config.mak

-LUA := ../../lua-4.0-loadmodule
+LUA := /usr/
 LUA_INCLUDE := $(LUA)/include
 LUA_LIBS := $(LUA)/lib/$(LIB_PRE)lua.$(LIB_EXT)

 CFLAGS := $(CFLAGS) -I$(LUA_INCLUDE) $(CC_DEBUG_FLAGS)
 LDFLAGS := $(SDL_LDFLAGS) $(LDFLAGS)

-TOLUA_LIBS := -ltolua
+TOLUA_LIBS := -ltolua++

 LUA_SDL_LIBS := $(TOLUA_LIBS) $(LUA_LIBS) $(SDL_LDFLAGS)

 all: $(LIB_PRE)luaSDL.$(DLL_EXT)

 SDL_tolua.c: SDL.pkg
-	tolua -n SDL -o $@ $^
+	tolua++ -n SDL -o $@ $^

 SDL_tolua.$(OBJ_EXT): SDL_tolua.c
 	$(CC) -c $^ -I../../../tolua/include -I$(LUA_INCLUDE)