pkulchenko / wxlua

wxlua: Lua bindings for wxWidgets cross-platform GUI toolkit; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
304 stars 59 forks source link

Help with building wxLua for 5.4.x (works fine for 5.1.x to 5.e.x etc) #113

Closed Echo-o-Tree closed 1 year ago

pkulchenko commented 1 year ago

@Echo-o-Tree, how are you building this and what error are you getting?

Echo-o-Tree commented 1 year ago

I'm trying to build wxLua using Lua 5.4.4, wxWidgets 3.2.1 and the current release of wxLua 3.2.0.2 I'm using CMake 3.25.0 to generate a MSV17 (2022) sln file and the MSV17 IDE to build and compile wxLua I've added the lua 5.4.4 source files to wxLua\modules, but the 5.4.dll doesn't work for building wxLua I get these errors when trying to build:

3>A:\lua\bin\lua54.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x340 3>Done building project "wxLuaModule.vcxproj" -- FAILED. 10>A:\lua\bin\lua54.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x340 10>Done building project "wxLuaFreeze.vcxproj" -- FAILED. 9>A:\lua\bin\lua54.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x340 9>Done building project "wxLua_app.vcxproj" -- FAILED. 11>A:\lua\bin\lua54.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x340 11>Done building project "wxLuaCan.vcxproj" -- FAILED.

pkulchenko commented 1 year ago

This looks like an issue with the generated file. Does lua54.dll look correct if you open it? What's the cmake command you used to configure it?

Echo-o-Tree commented 1 year ago

lua54.dll is obfuscated I used the cmake GUI to configure the build, I'll try from the cmd line The only changes I made in the Gui were to add the wxWidgets paths, and change the lua path to the 5.4 lua54.dll works fine with the lua interpreter.

More than likely, I configured something wrong. I'll rebuild the Lua 5.4.4, wxWidgets and wxLua using the instructions for 5.1

Is there anything special I need to do besides copying the lua5.4 source to wxLua\modules and the lua54.dll to the wxLua\luaproxydll?

pkulchenko commented 1 year ago

Is there anything special I need to do besides copying the lua5.4 source to wxLua\modules and the lua54.dll to the wxLua\luaproxydll?

You don't need to do these steps if the cmake configuration is done correctly. Here is what I use to build wxlua/wxwidgets on windows (using msys/gcc): https://github.com/pkulchenko/ZeroBraneStudio/blob/master/build/build-win32.sh#L309-L315. The last line of this command sets LUA_INCLUDE_DIR and LUA_LIBRARY values, which would point to Lua5.4 in your case.

Echo-o-Tree commented 1 year ago

Thank You!

This issue is/was 100% user error. I did not configure CMake GUI properly the first time.

Again, thank you.