Sign in to follow this  
Misery

LUA linker problem

Recommended Posts

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 :]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this