LUA - PLEEEESE help :P

Started by
4 comments, last by Saintly 22 years, 7 months ago
I read through the Lua docs and found that it''d be a good programming lang to use in a game I do in my spare time ... buut ... The precompiled libs for VC6 won''t link properly (Like, no functions exist in the libs ;P. All unresolved externals). Sooo ... I''m in need of help here.. Either someone who''s smart enough to recompile libraries for VC6 using the source. (I aint into putting libs together from their source dist, I stick with programming libs from scratch in winblows ) ...or someone who can tell me how to use the precompiled libs found on the Lua page. I''ve tried most everything, but it wont work. C''mon you guys ..
Advertisement
Did you include the libraries in your project?
And do you have a path to point to where they''re at?
Tools->Options->Directories->Libraries...

#pragma comment(lib, "lua.lib")


Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Yes I did ... I''m not totally outta it.

I said I''ve tried most everything...
I had a similar problem with that. For some reason, compiling with the .c or .cpp extension makes a difference. You can include just fine if you compile your main as main.c, or if you rename the lua files to have a .cpp extension.
Dog_Food is on the right track. C++ and C have different name decoration techniques that are used by the compiler to distinguish between, for example
int func(void)
and
int func(int a)

What you probably need to do is tell the compiler that the LUA header files are for C functions. You do it like this:

extern "C"
{
#include "lua.h"
}

Anything that you declare as extern "C" will use C naming rules. It sounds like this is probably your problem, although I can''t be 100% sure because I''ve never used LUA.

Hope that helps!
D''uh! ... I bet I read just that thing somewhere in the LUA example files .

How could I forget that ... Guess I''ve been too sleepy after work these days .

Thanks, I''ll try this once I git home. If it doesn''t work, I''ll come back and whine some more .

This topic is closed to new replies.

Advertisement