Evaluating Decoda - Can't debug my embedded code sample

bluntcoderbluntcoder Join Date: 2010-09-10 Member: 73965Members Posts: 2
edited September 2010 in Decoda
An exception has been caught: - attempt to call a nil value
Hello,

I'm evaluating Decoda for our next game. It looks pretty sweet so far, but I can't seem to get the debugger working with my embedded Lua sample executable. I have a simple program written in C++ that simply reads in an add() function and executes it. Essentially this sample: http://gamedevgeek.com/tutorials/calling-lua-functions/

I read that I had to embed lua directly in the program, so instead of statically linking to a lua5.1.lib, I downloaded the lua 5.1.4 source and threw it into my program. I set my project settings to the following:

Command: C:\Documents and Settings\marekm\My Documents\Visual Studio 2005\Projects\luadd\Debug\luaadd.exe
Command Arguments: [none]
Working Directory: C:\Documents and Settings\marekm\My Documents\Visual Studio 2005\Projects\luadd\Debug\


When I run with debugging, I get the following error pop up.

An exception has been caught: - attempt to call a nil value

If I use the release instead of the debug version, I get no pop up, but errors in the output:

Warning 1004: Couldn't hook Lua function 'lua_newthread'
Warning 1000: Lua functions were not found during debugging session


I'm using the latest Decoda with Lua 5.1.4. Sample program compiled with Visual Studio 2005 SP1 on Windows XP SP3.

Can anyone help me with this?

Comments

  • magicchicken0magicchicken0 Join Date: 2010-04-12 Member: 71362Members Posts: 5
    I had a problem with the missing lua functions too, which seemed to be from our linker optimization settings. It was eliminating functions or data that was never referenced (/OPT:REF switch in VS, which was only set in Release mode), and there's quite a few lua calls we were just never using ourselves.

    We threw in some extra dummy calls to the needed functions and the debugger could attach again.

    HOpe this helps

  • bluntcoderbluntcoder Join Date: 2010-09-10 Member: 73965Members Posts: 2
    edited September 2010
    Thanks for the tips. I tried removing the /OPT:REF and rebuilding, now Decoda just crashes the application when I try to run it (F5). But ideally I'd like to get it running in both Debug and Release modes.
    Post edited by Unknown User on
Sign In or Register to comment.