ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.06k stars 493 forks source link

LNK2001 errors after calling sol code #1507

Open JannesBonk opened 1 year ago

JannesBonk commented 1 year ago

I'm trying to implement Lua scripting in my game, and if I try to define/call a sol function, the compiler throws up alot of LNK2001 errors such as : scripting.obj : error LNK2001: unresolved external symbol __imp_luaL_traceback@@16 Example of code :

#include <iostream>
#include <sol/sol.hpp>

void setupLua(sol::state* luaState) noexcept
{
        luaState.open_libraries(sol::lib::base);
}

After I deleted sol::state* luaState and luaState.open_libraries(sol::lib::base);, I don't get any LNK2001 errors. I use visual studio 2022 with vcpkg includes . Any help will be apreciated