all referenced from SDL_main in main.o, which is the Cocoa wrapper for my SDL program.

I'm really lost as to what's going wrong, and every tutorial or forum I can find isn't specific enough to know what I'm missing.

Thanks in advance.

[EDIT]: Just to be clearer - I understand that the header files allow my program to compile, and that the linker error results from the linker trying to put the actual function definitions in with my code, I just don't know how to get the definitions to the linker.

You need to build lua, and add liblua.a to your project, or (probably easier) just add the lua source files to your project.

Note if you choose the latter option that at least one of the lua source files is for the standalone interpreter, which will cause "multiple definitions of _main" if you add it, so exercise a little caution.

Ok thanks, OSC. Now I need to figure out how to get Xcode to not target ppc architecture. I changed the project settings and the active target settings to "i386" instead of "ppc i386" but still get errors for ppc.

[EDIT]: Decided to just include source files, so ppc links fine too. Would be nice to know how to turn it off though.

Note if you choose the latter option that at least one of the lua source files is for the standalone interpreter, which will cause "multiple definitions of _main" if you add it, so exercise a little caution.

I ran into the duplicate symbols issue while trying to do exactly this. I commented out the 2 main() functions and the thing compiles fine and seems to work. So my question is to onesadcookie, is this this safe? And what did you mean by exercise a little caution?

The right way to do this will still to be to build lua on the command-line with make, and add the liblua.a to your project. I understand that that's not necessarily trivial to do, though, particularly if you want a multiarchitecture or iOS build.

If you want to add the source files to your project, you should only include those that belong to liblua, not those that belong to the interpreter. You should not have to edit any lua source, and I'd be wary of doing so. At best you'll end up compiling a bunch of code that's never called.

Originally I had intended to build the lib.a file via the command line (which I did do for my projects macosx target), however, after opening up the makefile and not seeing a iOS or arm anywhere I got nervous. Then I proceeded to poke around google for about an hour and still found nothing worthwhile. I can't believe there's not a binary floating around the Internet somewhere.

Also, how would you differentiate between files belonging to liblua and files belonging to the interpreter?