Closed MagicD3VIL closed 2 years ago
The issue seems to apply only to wxluafreeze
. Do you need to build this particular application? I think it's been this way for a while, but since I don't use that app and noone else expressed any interest in fixing it, it continues to fail. I've considered removing it completely, but if someone wants to fix it, I'd rather try to make it work instead of removing.
I indeed don't need wxLuaFreeze
. Can I (if so, how) remove it from the solution so that the wxLua.exe builds successfully? I'm pretty sure I only need wxLua.exe
and wx.dll
.
Yes, wxLua.exe doesn't depend on wxLuaFreeze.
It seems that the linker still has problems with unresolved externals. Microsoft's website lists a lot of reasons why this might be and since I've never encountered this, I have no idea how to resolve it. :confused:
EDIT: log
3> Creating library C:/Users/MagicD3VIL/Documents/wxLua/wxLua/windows-build/lib/Release/wx.lib and object C:/Users/MagicD3VIL/Documents/wxLua/wxLua/windows-build/lib/Release/wx.exp
3> wxLuaModule.vcxproj -> C:\Users\MagicD3VIL\Documents\wxLua\wxLua\windows-build\bin\Release\wx.dll
9>canlua.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_ERROR" (?wxEVT_LUA_ERROR@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B) referenced in function "public: virtual void __cdecl wxlCanObjScript::DoDraw(class wxDC &,double,double)" (?DoDraw@wxlCanObjScript@@UEAAXAEAVwxDC@@NN@Z)
10>wxlua.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_PRINT" (?wxEVT_LUA_PRINT@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B) referenced in function "void __cdecl `dynamic initializer for 'private: static struct wxEventTableEntry const * const wxLuaStandaloneApp::sm_eventTableEntries''(void)" (??__E?sm_eventTableEntries@wxLuaStandaloneApp@@0QBUwxEventTableEntry@@B@@YAXXZ)
10>wxlua.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_ERROR" (?wxEVT_LUA_ERROR@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B) referenced in function "void __cdecl `dynamic initializer for 'private: static struct wxEventTableEntry const * const wxLuaStandaloneApp::sm_eventTableEntries''(void)" (??__E?sm_eventTableEntries@wxLuaStandaloneApp@@0QBUwxEventTableEntry@@B@@YAXXZ)
9>cansim.obj : error LNK2001: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_ERROR" (?wxEVT_LUA_ERROR@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B)
9>cansim.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_PRINT" (?wxEVT_LUA_PRINT@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B) referenced in function "void __cdecl `dynamic initializer for 'private: static struct wxEventTableEntry const * const MyFrame::sm_eventTableEntries''(void)" (??__E?sm_eventTableEntries@MyFrame@@0QBUwxEventTableEntry@@B@@YAXXZ)
9>cansim.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxLuaEvent> const wxEVT_LUA_DEBUG_HOOK" (?wxEVT_LUA_DEBUG_HOOK@@3V?$wxEventTypeTag@VwxLuaEvent@@@@B) referenced in function "void __cdecl `dynamic initializer for 'private: static struct wxEventTableEntry const * const MyFrame::sm_eventTableEntries''(void)" (??__E?sm_eventTableEntries@MyFrame@@0QBUwxEventTableEntry@@B@@YAXXZ)
9>C:\Users\MagicD3VIL\Documents\wxLua\wxLua\windows-build\bin\Release\wxLuaCan.exe : fatal error LNK1120: 3 unresolved externals
10>C:\Users\MagicD3VIL\Documents\wxLua\wxLua\windows-build\bin\Release\wxLua.exe : fatal error LNK1120: 2 unresolved externals
11>------ Rebuild All started: Project: ALL_BUILD, Configuration: Release x64 ------
11> Building Custom Rule C:/Users/MagicD3VIL/Documents/wxLua/wxLua/CMakeLists.txt
12>------ Skipped Rebuild All: Project: PACKAGE, Configuration: Release x64 ------
12>Project not selected to build for this solution configuration
========== Rebuild All: 7 succeeded, 2 failed, 3 skipped ==========
wxlua application (wxLua/apps/wxlua/wxlua.cpp
) actually includes the following code, so I'm not sure why those constants are not defined:
BEGIN_EVENT_TABLE(wxLuaStandaloneApp, wxApp)
EVT_LUA_PRINT (wxID_ANY, wxLuaStandaloneApp::OnLua)
EVT_LUA_ERROR (wxID_ANY, wxLuaStandaloneApp::OnLua)
//EVT_LUA_DEBUG_HOOK (wxID_ANY, wxLuaStandaloneApp::OnLua)
END_EVENT_TABLE()
If you want to use wxlua, you don't need to necessarily use wxlua, as you can load wx.dll from any lua interpreter (that is compiled against the same version of Lua). You just need to make wx.dll available to your script and to require 'wx'
in it.
Yep, I know I need just libwx.so for Linux and wx.dll for Windows to run wxLua. I just didn't understand why building the executables on Windows didn't work. I guess this is just some linker environment issue and has really nothing to do with wxLua itself so feel free to close this issue.
Interesting how building on Linux is hassle-free when some would expect it to be the other way around. Also, I just want to say that I appreciate the swiftness of Your responses.
Cheers
I'm still not sure why exactly these errors are generated, but I don't have the Microsoft build environment to troubleshoot and figure it out. If anyone has more information on this or some ideas on how to fix, please update the ticket.
Greetings, I am building on Windows 7 64bit using Visual Studio 2015 but the build seems to fail while building the executables (libraries seem ok). I am using the same CMake configuration I used on Linux (except the path changes of course) where it was built without any issues. Lua is version 5.3.6, wxWidgets 3.0.5. and I have built everything (Lua and wxWidgets) as Release x64.
Build log
I don't build on Windows often so I really don't know how to fix these issues thus any help will be much appreciated. I can provide the solution file if it's needed.
Cheers