# Problems Compiling Luabind & quick question

This topic is 4359 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey guys :), I'm working on adding lua to an existing game engine written in directx. I have lua working fine at the moment (as in loading a script and binding basic functions), but i need a way of creating instances of c++ classes (with directx) from lua. This is mainly for creating an onScreenItem class, which is used for creating images for putting to the screen and controlling movement around the screen. Is this possible with luabind? Anyway the problem i'm having is with the linker when compiling luabind in visual studio .net. I'm pretty sure its due to the fact the linker is looking for C++ functions, but only finding C functions which it thinks are malformed? I'm not getting very far with it though. I'd assume... extern "C" { } would be needed? but i'm not 100%. The output is below, if anyone can help i'd be very greatful :) Thanks! Compiling... stack_content_by_name.cpp open.cpp object.cpp implicit_cast.cpp function.cpp find_best_match.cpp create_class.cpp class_rep.cpp \Desktop\luabind-b6\luabind\src\class_rep.cpp(1517) : warning C4800: 'const int' : forcing value to bool 'true' or 'false' (performance warning) Generating Code... Linking... implicit_cast.obj : error LNK2001: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@$$J0YAXPAUlua_State@@H@Z) object.obj : error LNK2001: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@$$J0YAXPAUlua_State@@H@Z) open.obj : error LNK2001: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@$$J0YAXPAUlua_State@@H@Z) stack_content_by_name.obj : error LNK2001: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@$$J0YAXPAUlua_State@@H@Z) class_rep.obj : error LNK2001: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@J0YAXPAUlua_State@@H@Z) .... D:\Desktop\luabindLib\Debug\luabindLib.exe : fatal error LNK1120: 36 unresolved externals

##### Share on other sites
Ok i've been working on this for hours now, and i'm sure i'm getting closer :( I have it almost compiling, the only problem is with include files within the visual studio path. I've uploaded the build log to my website, you can see it below:

www.phub.co.uk/external/files/BuildLog.htm

Any Ideas?

thanks

##### Share on other sites
OMG i can't believe i wasted so much time on this... for anyone who may ever experience the same, it was just a simple matter of having my includes the wrong way around. Luabind includes didn't like being referenced before my own.

I never thought it mattered, but it was screwing something up!!!

##### Share on other sites

This topic is 4359 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.