LUA linker problem

Started by
0 comments, last by the_edd 13 years, 4 months ago
Hi there,

I'm willing to place a scripting language in my C/C++ app. I've heard that LUA is very suitable for my purposes. But unfortunately I have problem with building it/including it.

I have tried to build it with bcc32.exe (borland compiler).
I got few warnings and unresolved external error.

I have tried using installer distribution build for windows and after including

extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"

}

int main()
{
lua_State *L = lua_open();
lua_close(L);
return 0;
}

all *.h files I get (lib folder has been added to linker paths):

[Linker Error] Error: Unresolved external '_luaL_newstate' referenced from H:\~path
[Linker Error] Error: Unresolved external '_lua_close' referenced from H:\~path

I tried also including header files from source distribution, and I get the same error. Being aware that bcb compiler causes sometimes problems I have also tried using g++ and gcc, and I have the same errors :(

How to fix it?
Thanks in advance for answers and suggestions :]
Advertisement
Quote:Original post by Misery
all *.h files I get (lib folder has been added to linker paths):


But do you actually specify the library name i.e. add -llua (GCC) or lua.lib (Borland) to your linker command line?

This topic is closed to new replies.

Advertisement