lua-users home
lua-l archive

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

--- In, Brian Swetland <swetland@f...> wrote:
> ["pion1013 <pion1013@n...>" <pion1013@n...>]
> > Hi,
> > 
> > I'm trying to port Lua 4.0.1 to GP32, a handheld game machine 
> > on an ARM chip.
> > 
> > The entry point of any program written for GP32 with it's SDK is 
> > Main, not main or WinMain. The problem is, if I want to use any 
> > the lua-calling function (say, lua_open()), the compiler gives me 
> > error, saying "Undefined symbol main (referred from kernel.o)."
> > 
> > I'm suspecting Lua is reffering to main() function. Where should 
> > look into, and what should I change? Please help.
> Lua doesn't make any use of the main() symbol.  Sounds like 
> in kernel.o wants it though.  Is that part of the system library 
> this GP32 thing?
> Brian

Without diving into Lua code, I tested some combinations.

First, GP32 program with lua, compiled for Windows - compile/runs 
fine. Note that with GP32 SDK, I can make a GP32-emulated version for 
windows. For this, I used Lua for Windows.

Second, GP32 program without Lua - compiles/runs on the machine fine

Third, main() function without GP32 support, but with Lua - compiles 
fine. But I can't run it, 'cause I cannot run it on the machine 
without GP32 core

Fourth, GP32 program with Lua - can't compile. "Undefined symbol main 
(referred from kernel.o)."

Those tests leads me to think there's something in Lua library that 
wants main(). Here's some more tests:

GP32 program with Lua and main() - can't compile. The compiler 
says "multiple entry points".

GP32 program with Lua, renamed Main() to main - can't compile. need 
Main (referred from init.o). Note that init.o is the entry point for 

Apparently, if Lua library doesn't refer to main(), kernel.o does. 
But I can't find and of kernel thing on my computer. It may be the 
standard C routines that Lua uses. Depending on the implementation of 
ADS 1.2, I think it is possible .

Any comments or suggestions?


Won-Seok "Pion" Chang
Griffon Studio