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.12k stars 500 forks source link

Crashing when use LuaJIT2.0.5 and 2.10-beta3 #1445

Open zRafaReis opened 1 year ago

zRafaReis commented 1 year ago

I am crashing when using "sol::state_view lua_state(g_LuaState)"

Code: image

i debbugged and when calling sol::state_view i crash

zRafaReis commented 1 year ago

i forgot to say when i use LuaJIT2.10-beta3 i crash when i call luaL_newstate

g0dzcsgo commented 1 year ago

How did you manage to make the luajit header files not error?

Whenever I include all the header files from luajit and also statically link against the libraries I get tons of errors inside the luajit header files such as:

luajit\src\lib_jit.c(627,3): error C2065: 'lj_lib_init_jit_profile': undeclared identifier luajit\src\lib_jit.c(627,3): error C2065: 'lj_lib_cf_jit_profile': undeclared identifier luajit\src\lj_libdef.h(115,20): error C2065: 'lj_ffh_string_len': undeclared identifier luajit\src\lj_libdef.h(119,20): error C2065: 'lj_ffh_string_rep': undeclared identifier luajit\src\lj_libdef.h(114,49): error C2099: initializer is not a constant luajit\src\lib_table.c(304,57): error C2065: 'FF_table_new': undeclared identifier luajit\src\lib_table.c(309,61): error C2065: 'FF_table_clear': undeclared identifier luajit\src\lj_libdef.h(139,23): error C2065: 'lj_cf_table_foreachi': undeclared identifier

And some more..?

yhyu13 commented 3 months ago

simply using vcpkg sol2 and luajit, they work like a charm sharing my findluajit.cmake file bc vcpkg luajit is only a pkg-config not package: https://github.com/yhyu13/HLVM-Engine/blob/f9f48e11b1481773a9d763d0723d21950a8f4c38/Engine/Source/Common/cmake/Findluajit.cmake