lua-users home
lua-l archive

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

Hi, I am currently working on a cross-platform program
that uses Lua. Everything works great except for 2
issues in Windows (using VC6 as a compiler in case it

I've searched the mailing list archive and have seen
indirect references to my problem (and gripes about
people like me complaining about it :P), but I can't
seem to find an explict cause/solution so I would
really appreciate some feedback.

First, when I use "print" in my Lua scripts, it causes
my entire program to crash. I typically use it for
debugging and sometimes I forget to remove them when I
test in Windows. I did discover that if I define my
own print function in C (which just calls printf) and
call it from Lua, my program doesn't crash. Can
somebody explain this to me, and more importantly, is
there a way I can get Windows to work with print?

My second problem is similar to the first. When ever I
have an error in my Lua script (or something where Lua
triggers an error), my entire program crashes in
Windows. In Linux (or Mac, or anywhere else), Lua
gracefully returns a simple error and my program can
simply move on and gracefully continue. But in
Windows, everything just comes crashing down and this
really disturbs me. 

I've even gone to the extreme of trying to enclose all
Lua calls with exception handling in C++ (try/catch
blocks) to see if I could get Windows to survive the
Lua errors, but it still crashes.

Is there something I can do to prevent my application
from crashing when this happens? (This one is more
important to me that the print issue.)


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.