Importing Lua as a static library

I am attempting to import Lua 5.3 as a static library into my current game project. I have followed [this][1] to the letter, and to no avail. When I try to build the solution, I get these errors:

I have both downloaded and tried lua-5.3_Win64_vc12_lib.zip and lua-5.3_Win32_vc12_lib.zip from [here][3], as well as building lua myself and trying that. All to no avail. Here is my module implementation code:

public bool LoadLua(TargetInfo Target)
{
    bool isLibrarySupported = false;

    if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
    {
        isLibrarySupported = true;

        string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
        string LibrariesPath = Path.Combine(ThirdPartyPath, "Lua", "Libraries");

        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "lua53." + PlatformString + ".lib"));
    }

    if (isLibrarySupported)
    {
        // Include path
        PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Lua", "Includes"));
    }

    Definitions.Add(string.Format("WITH_LUA_BINDING={0}", isLibrarySupported ? 1 : 0));

    return isLibrarySupported;
}

It was mostly copied from the tutorial, but I laid out the directory structure to meet their requirements as well.

Please also note I am not trying to use lua to code my game instead of C++, or anything like that, I am just trying to implement lua into the game because there will be programmable parts in it (all done in lua).

Thankyou for your time.

If you ever get this done, please make a tutorial about it!

You don’t have to listen to the Visual Studio’s error log.

Look at the output log since IntelSense may give you false errors.

Make sure this code path points to the valid .lib files and is getting called.

   PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "lua53." + PlatformString + ".lib"));

Please make sure you’re using the correct libraries / platform.
http://www.cplusplus.com/forum/windows/114016/

Well I have toyed around with it some more, and am now producing a different error: error LNK2019: unresolved external symbol _HUGE referenced in function luaopen_math

I guess you need to recompile lua from source to get proper 64bit binaries for ue4. Try with a newer version of vs. (vs120 maybe?)

Hello!

I’m having the same problem here, I don’t know if you resolved it?

I manage to get to the point where the Compiler recognizes "#include " and finishes without errors. But once I actually try to add code like for example lua_State *L = luaL_newstate(); the compiler gets a Linker error.

I guess the problem could be that the stock Library for LUA is in 32bit.

Any Help would be appreciated!

For what it’s worth, recompiling from source worked for me in removing the unresolved external symbol __HUGE issue. Fortunately it’s not painful at all, either.