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
306 stars 59 forks source link

mingw compilation 64 bits errors on wxhtml_bind.cpp #32

Closed sonoro1234 closed 5 years ago

sonoro1234 commented 5 years ago

with compiler x86_64-8.1.0-release-posix-seh-rt_v6-rev0

[ 54%] Building CXX object wxLuaBundled/wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxhtml_bind.cp
p.obj
cd /d C:\supercolliderrepos\aaabuildlua2sctest64\wxLuaBundled\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-
seh-rt_v6-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDIN
G_WXAUI=1 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxL
UA_USEBINDING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_US
EBINDING_WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMak
eFiles/wxLuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-dec
larations -o CMakeFiles\wxLuaModule.dir\__\wxbind\src\wxhtml_bind.cpp.obj -c C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\
wxLua\modules\wxbind\src\wxhtml_bind.cpp
C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp: In function 'int wxLua_wxSimpleHtml
ListBox_Append2(lua_State*)':
C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:3569:46: warning: cast to pointer fr
om integer of different size [-Wint-to-pointer-cast]
     int returns = (self->Append(item, (void*)number));
                                              ^~~~~~
C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp: At global scope:
C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:5200:134: error: cast from 'wxHtmlWi
ndowInterface*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long int)(wxHtmlWindowInterface*)(wxSimpleHtmlL
istBox*)&wxluatype_TNONE) - ((long int)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };

         ^~~~~~~~~~~~~~~
C:\supercolliderrepos\Lua2SC\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:5200:187: error: cast from 'wxSimple
HtmlListBox*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long int)(wxHtmlWindowInterface*)(wxSimpleHtmlL
istBox*)&wxluatype_TNONE) - ((long int)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };

skipping this component, the same error happens in wxcore_bind.cpp (which cant be removed as component)

pkulchenko commented 5 years ago

@sonoro1234, I suspect this may be not related to 64bit, but rather to the changes in the API that changed some of the parameters. I remember seeing changes in Html-related components that required wxlua updates. I'll take a look.

sonoro1234 commented 5 years ago

But I could compile in mingw 32 bits and ( what its worse) in gcc linux 64 bits.

pkulchenko commented 5 years ago

@sonoro1234, can you retry with the most recent changes in https://github.com/pkulchenko/wxlua/commits/wxwidgets312? I suspect that this issue may go away...

sonoro1234 commented 5 years ago

I am on the way

sonoro1234 commented 5 years ago

wxWidgets not found with x86_64-8.1.0-release-posix-seh-rt_v6-rev0

-- * ---------------------------------------------------------------------------
-- * CMake command line options and tips specific to this project
-- *
-- * In the CMake GUI you can set values and press configure a few times
-- * and until there are no more red items, then press generate.
-- *
-- * Usage: cmake -D[OPTION_NAME]=[OPTION_VALUE] /path/to/CMakeLists.txt/
-- * ---------------------------------------------------------------------------
-- * -DHELP=TRUE
-- *   Show this help message and exit, no files will be generated.
-- * -DCMAKE_BUILD_TYPE=[Debug, Release, RelWithDebInfo, MinSizeRel] : (Default Debug)
-- *   Makefiles : You must set the build type to Debug, Release...
-- *   MSVC GUI  : No need to set this since you can choose it in the GUI.
-- * -DBUILD_SHARED_LIBS=[TRUE, FALSE] : (Default static in MSW, shared in Linux)
-- *   Build shared (.DLL or .so) or static (.lib or .a) libraries.
-- * ---------------------------------------------------------------------------
--
--
-- *****************************************************************************
-- * BUILD TYPE:        Release
-- * BUILD_SHARED_LIBS: FALSE
-- *****************************************************************************
-- * System is 32-bit FALSE, is 64-bit TRUE
-- *****************************************************************************
-- * CMAKE_SOURCE_DIR = C:/supercolliderrepos/wxLuaBundled
-- * CMAKE_BINARY_DIR = C:/supercolliderrepos/build_wxLuaBundled312_64
-- *****************************************************************************
--
-- * ---------------------------------------------------------------------------
-- * wxWidgets library settings :
-- *
-- * Note that ONLY an all shared (DLL) or all static build is supported.
-- *   I.E. If you choose shared you must link to shared wxWidgets libs.
-- *   Set -DBUILD_SHARED_LIBS=[TRUE, FALSE] to control shared/static lib.
-- *
-- * Finding wxWidgets for MSW and MSVC
-- * -DwxWidgets_ROOT_DIR=[path] : (e.g. /path/to/wxWidgets/)
-- *   Path to the root of the wxWidgets build, must at least set this.
-- * -DwxWidgets_LIB_DIR=[path] : (e.g. /path/to/wxWidgets/lib/vc_lib/)
-- *   Path to the wxWidgets lib dir also set this if libs can't be found.
-- * -DwxWidgets_CONFIGURATION=[configuration] :
-- *   Set wxWidgets configuration; e.g. msw, mswu, mswunivu...
-- *   Where 'u' = unicode and 'd' = debug.
-- *   MSVC GUI : You need only choose msw, mswu, mswuniv, mswunivu since
-- *              release or debug mode is chosen in the GUI.
-- * -DwxWidgets_COMPONENTS=[...stc;html;adv;core;base or mono] :
-- *   For non-monolithic builds choose the wxWidgets libs to link to.
-- *    xrc;xml;gl;net;media;propgrid;richtext;aui;stc;html;adv;core;base
-- *   For monolithic builds choose mono and the contribs libs.
-- *    stc;mono
-- *   The extra decorations, e.g. wxmsw28ud_adv.lib, will be searched for.
-- *   Libs that cannot be found will be printed below, please fix/remove
-- *   them to be able to build this project.
-- *   You will get compilation/linker errors if wxWidgets is not found.
-- *
-- * Finding wxWidgets for GCC and Unix type systems
-- * -DwxWidgets_CONFIG_EXECUTABLE=[path/to/wx-config] :
-- *   Specify path to wx-config script for GCC and Unix type builds
-- * ---------------------------------------------------------------------------
--
-- * Using these wxWidgets components: stc;scintilla;gl;html;aui;adv;core;net;base
-- Could NOT find wxWidgets (missing:  wxWidgets_FOUND)
-- *
CMake Warning at wxlua/wxLua/build/CMakewxAppLib.cmake:336 (message):
  * WARNING: Could not find wxWidgets! Please see help above.
Call Stack (most recent call first):
  wxlua/wxLua/CMakeLists.txt:58 (FIND_WXWIDGETS)

-- * - wxWidgets_VERSION           = 3.1.3 = 3.1.3
-- * - wxWidgets_COMPONENTS        = stc;scintilla;gl;html;aui;adv;core;net;base
-- * - wxWidgets_INCLUDE_DIRS      =
-- * - wxWidgets_LIBRARY_DIRS      = wxWidgets_LIB_DIR-NOTFOUND
-- * - wxWidgets_LIBRARIES         =
-- * - wxWidgets_CXX_FLAGS         =
-- * - wxWidgets_DEFINITIONS       =
-- * - wxWidgets_DEFINITIONS_DEBUG =
-- * - wxWidgets_PORTNAME          =
-- * - wxWidgets_UNIVNAME          =
-- * - wxWidgets_UNICODEFLAG       =
-- * - wxWidgets_DEBUGFLAG         =
 WARNING: Unable to find requested wxWidgets component : stc
 WARNING: Unable to find requested wxWidgets component : scintilla
 WARNING: Unable to find requested wxWidgets component : gl
 WARNING: Unable to find requested wxWidgets component : html
 WARNING: Unable to find requested wxWidgets component : aui
 WARNING: Unable to find requested wxWidgets component : adv
 WARNING: Unable to find requested wxWidgets component : core
 WARNING: Unable to find requested wxWidgets component : net
 WARNING: Unable to find requested wxWidgets component : base
-- *
wxWidgets requested but not found.
-- * WARNING: Specified wxLuaBinding lib 'webview' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so
t will not be compiled.
-- * WARNING: Specified wxLuaBinding lib 'xrc' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so it w
ll not be compiled.
-- * WARNING: Specified wxLuaBinding lib 'richtext' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so
it will not be compiled.
-- * WARNING: Specified wxLuaBinding lib 'propgrid' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so
it will not be compiled.
-- * WARNING: Specified wxLuaBinding lib 'media' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so it
will not be compiled.
-- * WARNING: Specified wxLuaBinding lib 'xml' in variable wxLuaBind_COMPONENTS is missing from wxWidgets_COMPONENTS so it w
ll not be compiled.
-- * wxLua using external/system Lua library :
-- *   - include dir : C:/luaGL/sources/lua-5.1.5/src
-- *   - library     : C:/anima64/Lua51.dll
-- * Not copying the Lua proxydlls since they do not work in the 64-bit build.
-- * WARNING: cppcheck NOT found, NOT generating ADD_CPPCHECK_TEST() tests
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.14") found components:  doxygen missing compo
ents:  dot
-- * Doxygen found, run $make wxLua_doxygen to generate documentation in build folder.
CMake Warning at wxlua/wxLua/build/CMakeFunctions.cmake:586 (MESSAGE):
  Missing directory in
  ADD_SUBDIRECTORY(C:/supercolliderrepos/wxLuaBundled/wxlua/wxLua/modules/wxstedit)
Call Stack (most recent call first):
  wxlua/wxLua/CMakeLists.txt:372 (add_subdirectory)

MINGW_EXTRA_LIBS is -lversion-lshlwapi-luxtheme-loleacc-lws2_32
MINGW_EXTRA_LIBS is -lversion-lshlwapi-luxtheme-loleacc-lws2_32
CMake Warning (dev) at wxlua/wxLua/build/CMakeFunctions.cmake:1010 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "WIN32" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  wxlua/wxLua/apps/CMakeLists.txt:33 (ADD_EXECUTABLE_FULL)
  wxlua/wxLua/apps/wxlua/CMakeLists.txt:3 (wxLua_Apps_wxLua_TARGETS)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at wxlua/wxLua/build/CMakeFunctions.cmake:1010 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "WIN32" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  wxlua/wxLua/apps/CMakeLists.txt:63 (ADD_EXECUTABLE_FULL)
  wxlua/wxLua/apps/wxluacan/CMakeLists.txt:3 (wxLua_Apps_wxLuaCan_TARGETS)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- * WARNING: wxLuaEdit application will not be built since wxStEdit was not found.
-- * WARNING: wxStEdit_ROOT_DIR directory does not exist: ''
CMake Warning (dev) at wxlua/wxLua/build/CMakeFunctions.cmake:1010 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "WIN32" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  wxlua/wxLua/apps/CMakeLists.txt:139 (ADD_EXECUTABLE_FULL)
  wxlua/wxLua/apps/wxluafreeze/CMakeLists.txt:3 (wxLua_Apps_wxLuaFreeze_TARGETS)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/supercolliderrepos/build_wxLuaBundled312_64

The cause seems to be that instead of gcc_lib now we get gcc_x64_lib on setting wxWidgets_LIB_DIR It was not an issue in my other 64bit builds, may be wxWidgets has changed behaviour?

Once solved the above issue the build complains

[  9%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxhtml_bind.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxbind\src\wxhtml_bind.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wx
bind\src\wxhtml_bind.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp: In function 'int wxLua_wxSimpleHtmlListBox
_Append2(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:4435:46: warning: cast to pointer from inte
ger of different size [-Wint-to-pointer-cast]
     int returns = (self->Append(item, (void*)number));
                                              ^~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp: At global scope:
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:6173:134: error: cast from 'wxHtmlWindowInt
erface*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long int)(wxHtmlWindowInterface*)(wxSimpleHtmlL
istBox*)&wxluatype_TNONE) - ((long int)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };

         ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxhtml_bind.cpp:6173:187: error: cast from 'wxSimpleHtmlLis
tBox*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long int)(wxHtmlWindowInterface*)(wxSimpleHtmlL
istBox*)&wxluatype_TNONE) - ((long int)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };

                                                              ^~~~~~~~~~~~~~~

The error is similar to the one before.

pkulchenko commented 5 years ago

@sonoro1234, this looks like a type mismatch. I just compiled on macOS 64bit, but didn't get any warnings there. I'll compile on Win64 as well to see if I can reproduce it. Meantime, can you try the following patch:

diff --git a/wxLua/modules/wxbind/src/wxhtml_bind.cpp b/wxLua/modules/wxbind/src/wxhtml_bind.cpp
index c08139a..ce2d120 100644
--- a/wxLua/modules/wxbind/src/wxhtml_bind.cpp
+++ b/wxLua/modules/wxbind/src/wxhtml_bind.cpp
@@ -4455,7 +4455,7 @@ static int LUACALL wxLua_wxSimpleHtmlListBox_Append2(lua_State *L);
 static int LUACALL wxLua_wxSimpleHtmlListBox_Append2(lua_State *L)
 {
     // voidptr_long number
-    long number = (long)wxlua_getnumbertype(L, 3);
+    long long number = (long long)wxlua_getnumbertype(L, 3);
     // const wxString item
     const wxString item = wxlua_getwxStringtype(L, 2);
     // get this
@@ -6199,7 +6199,7 @@ static wxLuaBindClass* wxluabaseclassbinds_wxSimpleHtmlListBox[] = { NULL, NULL
     extern wxLuaBindMethod wxSimpleHtmlListBox_methods[];
     extern int wxSimpleHtmlListBox_methodCount;
     static wxLuaArgType wxluabaseclass_wxluatypes_wxSimpleHtmlListBox[] = { &wxluatype_wxHtmlWindowInterface, NULL };
-    static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long int)(wxHtmlWindowInterface*)(wxSimpleHtmlListBox*)&wxluatype_TNONE) - ((long int)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };
+    static int wxluabaseclass_vtable_offsets_wxSimpleHtmlListBox[] = { int(((long long)(wxHtmlWindowInterface*)(wxSimpleHtmlListBox*)&wxluatype_TNONE) - ((long long)(wxSimpleHtmlListBox*)&wxluatype_TNONE)) };
     extern void wxLua_wxSimpleHtmlListBox_delete_function(void** p);
 #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML)
sonoro1234 commented 5 years ago

With the patch the error is gone (but I guess it should be ifdefed for 64bits) Another errors appear:

[ 20%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_bind.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxbind\src\wxcore_bind.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wx
bind\src\wxcore_bind.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5575:118: error: cast from 'wxItemContainer
*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxCheckListBox[] = { int(((long int)(wxItemContainer*)(wxCheckListBox*)&wxluaty
pe_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxCheckListBox*)&wxlua
type_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)) };
                                                                                                                      ^~~~~~~
~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5575:166: error: cast from 'wxCheckListBox*
' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxCheckListBox[] = { int(((long int)(wxItemContainer*)(wxCheckListBox*)&wxluaty
pe_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxCheckListBox*)&wxlua
type_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)) };

                                         ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5575:245: error: cast from 'wxItemContainer
Immutable*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxCheckListBox[] = { int(((long int)(wxItemContainer*)(wxCheckListBox*)&wxluaty
pe_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxCheckListBox*)&wxlua
type_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)) };

                                                                                                                        ^~~~~
~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5575:293: error: cast from 'wxCheckListBox*
' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxCheckListBox[] = { int(((long int)(wxItemContainer*)(wxCheckListBox*)&wxluaty
pe_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxCheckListBox*)&wxlua
type_TNONE) - ((long int)(wxCheckListBox*)&wxluatype_TNONE)) };

                                           ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5735:122: error: cast from 'wxItemContainer
*' to 'long int' loses precision [-fpermissive]
 static int wxluabaseclass_vtable_offsets_wxControlWithItems[] = { int(((long int)(wxItemContainer*)(wxControlWithItems*)&wxl
uatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxControlWithI
tems*)&wxluatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)) };
                                                                                                                          ^~~
~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5735:174: error: cast from 'wxControlWithIt
ems*' to 'long int' loses precision [-fpermissive]
 static int wxluabaseclass_vtable_offsets_wxControlWithItems[] = { int(((long int)(wxItemContainer*)(wxControlWithItems*)&wxl
uatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxControlWithI
tems*)&wxluatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)) };

                                                 ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5735:257: error: cast from 'wxItemContainer
Immutable*' to 'long int' loses precision [-fpermissive]
 static int wxluabaseclass_vtable_offsets_wxControlWithItems[] = { int(((long int)(wxItemContainer*)(wxControlWithItems*)&wxl
uatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxControlWithI
tems*)&wxluatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)) };

       ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:5735:309: error: cast from 'wxControlWithIt
ems*' to 'long int' loses precision [-fpermissive]
 static int wxluabaseclass_vtable_offsets_wxControlWithItems[] = { int(((long int)(wxItemContainer*)(wxControlWithItems*)&wxl
uatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxControlWithI
tems*)&wxluatype_TNONE) - ((long int)(wxControlWithItems*)&wxluatype_TNONE)) };

                                                           ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6028:106: error: cast from 'wxItemContainer
*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxChoice[] = { int(((long int)(wxItemContainer*)(wxChoice*)&wxluatype_TNONE) -
((long int)(wxChoice*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxChoice*)&wxluatype_TNONE) - ((long int
)(wxChoice*)&wxluatype_TNONE)) };
                                                                                                          ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6028:148: error: cast from 'wxChoice*' to '
long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxChoice[] = { int(((long int)(wxItemContainer*)(wxChoice*)&wxluatype_TNONE) -
((long int)(wxChoice*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxChoice*)&wxluatype_TNONE) - ((long int
)(wxChoice*)&wxluatype_TNONE)) };

                       ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6028:221: error: cast from 'wxItemContainer
Immutable*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxChoice[] = { int(((long int)(wxItemContainer*)(wxChoice*)&wxluatype_TNONE) -
((long int)(wxChoice*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxChoice*)&wxluatype_TNONE) - ((long int
)(wxChoice*)&wxluatype_TNONE)) };

                                                                                                ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6028:263: error: cast from 'wxChoice*' to '
long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxChoice[] = { int(((long int)(wxItemContainer*)(wxChoice*)&wxluatype_TNONE) -
((long int)(wxChoice*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxChoice*)&wxluatype_TNONE) - ((long int
)(wxChoice*)&wxluatype_TNONE)) };

             ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6069:110: error: cast from 'wxItemContainer
*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxComboBox[] = { int(((long int)(wxItemContainer*)(wxComboBox*)&wxluatype_TNONE
) - ((long int)(wxComboBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxComboBox*)&wxluatype_TNONE) - ((
long int)(wxComboBox*)&wxluatype_TNONE)) };
                                                                                                              ^~~~~~~~~~~~~~~

C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6069:154: error: cast from 'wxComboBox*' to
 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxComboBox[] = { int(((long int)(wxItemContainer*)(wxComboBox*)&wxluatype_TNONE
) - ((long int)(wxComboBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxComboBox*)&wxluatype_TNONE) - ((
long int)(wxComboBox*)&wxluatype_TNONE)) };

                             ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6069:229: error: cast from 'wxItemContainer
Immutable*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxComboBox[] = { int(((long int)(wxItemContainer*)(wxComboBox*)&wxluatype_TNONE
) - ((long int)(wxComboBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxComboBox*)&wxluatype_TNONE) - ((
long int)(wxComboBox*)&wxluatype_TNONE)) };

                                                                                                        ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6069:273: error: cast from 'wxComboBox*' to
 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxComboBox[] = { int(((long int)(wxItemContainer*)(wxComboBox*)&wxluatype_TNONE
) - ((long int)(wxComboBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxComboBox*)&wxluatype_TNONE) - ((
long int)(wxComboBox*)&wxluatype_TNONE)) };

                       ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6337:108: error: cast from 'wxItemContainer
*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxListBox[] = { int(((long int)(wxItemContainer*)(wxListBox*)&wxluatype_TNONE)
- ((long int)(wxListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxListBox*)&wxluatype_TNONE) - ((long
 int)(wxListBox*)&wxluatype_TNONE)) };
                                                                                                            ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6337:151: error: cast from 'wxListBox*' to
'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxListBox[] = { int(((long int)(wxItemContainer*)(wxListBox*)&wxluatype_TNONE)
- ((long int)(wxListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxListBox*)&wxluatype_TNONE) - ((long
 int)(wxListBox*)&wxluatype_TNONE)) };

                          ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6337:225: error: cast from 'wxItemContainer
Immutable*' to 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxListBox[] = { int(((long int)(wxItemContainer*)(wxListBox*)&wxluatype_TNONE)
- ((long int)(wxListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxListBox*)&wxluatype_TNONE) - ((long
 int)(wxListBox*)&wxluatype_TNONE)) };

                                                                                                    ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6337:268: error: cast from 'wxListBox*' to
'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxListBox[] = { int(((long int)(wxItemContainer*)(wxListBox*)&wxluatype_TNONE)
- ((long int)(wxListBox*)&wxluatype_TNONE)), int(((long int)(wxItemContainerImmutable*)(wxListBox*)&wxluatype_TNONE) - ((long
 int)(wxListBox*)&wxluatype_TNONE)) };

                  ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6626:106: error: cast from 'wxTextEntry*' t
o 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxTextCtrl[] = { int(((long int)(wxTextEntry*)(wxTextCtrl*)&wxluatype_TNONE) -
((long int)(wxTextCtrl*)&wxluatype_TNONE)) };
                                                                                                          ^~~~~~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_bind.cpp:6626:150: error: cast from 'wxTextCtrl*' to
 'long int' loses precision [-fpermissive]
     static int wxluabaseclass_vtable_offsets_wxTextCtrl[] = { int(((long int)(wxTextEntry*)(wxTextCtrl*)&wxluatype_TNONE) -
((long int)(wxTextCtrl*)&wxluatype_TNONE)) };

                         ^~~~~~~~~~~~~~~
pkulchenko commented 5 years ago

@sonoro1234, I pushed a fix to ptrdiff branch that should fix this issue. I tested it on 32bit platform without issues and expect it to work on 64bit as well. I'm not happy about assigning the difference to int, but it shouldn't be much of an issue given the context. Let me know if the patch works for you.

sonoro1234 commented 5 years ago

with branch ptrdiff

[ 11%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_controls.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxbind\src\wxcore_controls.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\module
s\wxbind\src\wxcore_controls.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxItemContainer
_Append1(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:1995:46: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
     int returns = (self->Append(item, (void*)number));
                                              ^~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxItemContainer
_GetClientData(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:2077:49: error: cast from 'void*' to 'l
ong int' loses precision [-fpermissive]
     long  returns = (long )self->GetClientData(n);
                                                 ^
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxItemContainer
_Insert1(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:2171:51: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
     int returns = (self->Insert(item, pos, (void*)number));
                                                   ^~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxItemContainer
_SetClientData(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:2211:35: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
     self->SetClientData(n, (void*)number);
                                   ^~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxListCtrl_Sort
Items(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:5091:70: error: cast from 'wxLua_LCF_da
ta*' to 'long int' loses precision [-fpermissive]
     bool returns = self->SortItems(wxLua_ListCompareFunction, (long)&LCF_data);
                                                                      ^~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxTreeItemId_Ge
tValue(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:13555:32: error: cast from 'wxItemId<vo
id*>::Type' {aka 'void*'} to 'long int' loses precision [-fpermissive]
     long returns = (long)self->m_pItem;
                                ^~~~~~~
mingw32-make[2]: *** [wxlua\wxLua\modules\luamodule\CMakeFiles\wxLuaModule.dir\build.make:225: wxlua/wxLua/modules/luamodule/
CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_controls.cpp.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/supercolliderrepos/build_wxLuaBundled312_64'
mingw32-make[1]: *** [CMakeFiles\Makefile2:419: wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
mingw32-make[1]: Leaving directory 'C:/supercolliderrepos/build_wxLuaBundled312_64'
mingw32-make: *** [Makefile:154: all] Error 2
pkulchenko commented 5 years ago

@sonoro1234, pushed another commit into the same branch. Give it a try...

sonoro1234 commented 5 years ago

got this

[  6%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_controls.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxbind\src\wxcore_controls.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\module
s\wxbind\src\wxcore_controls.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp: In function 'int wxLua_wxItemContainer
_GetClientData(lua_State*)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxbind\src\wxcore_controls.cpp:2077:49: error: cast from 'void*' to 'l
ong int' loses precision [-fpermissive]
     long  returns = (long )self->GetClientData(n);
pkulchenko commented 5 years ago

@sonoro1234, pushed another update, but you may need to force the fetch, as I amended the existing commit, as some of the earlier changes were not quite correct.

sonoro1234 commented 5 years ago

Still not.

[ 68%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxlua/debug/wxlstack.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxlua\debug\wxlstack.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlu
a\debug\wxlstack.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\debug\wxlstack.cpp: In member function 'bool wxLuaStackDialog::E
xpandItem(long int)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\debug\wxlstack.cpp:1093:51: error: cast from 'wxLuaStackListData
*' to 'long int' loses precision [-fpermissive]
                 m_expandedItems[long_key] = (long)stkListData;
                                                   ^~~~~~~~~~~
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\debug\wxlstack.cpp:1113:81: warning: cast to pointer from intege
r of different size [-Wint-to-pointer-cast]
                         int n = m_listData.Index((void*)m_expandedItems[long_key]);
                                                                                 ^
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\debug\wxlstack.cpp:1126:51: error: cast from 'wxLuaStackListData
*' to 'long int' loses precision [-fpermissive]
                 m_expandedItems[long_key] = (long)stkListData;
                                                   ^~~~~~~~~~~
pkulchenko commented 5 years ago

@sonoro1234, pushed one more update. It should address the issue with long in the debug module. After we get it working, I plan to switch to wxUIntPtr in all the places, including those I updated earlier, as it's a better option.

sonoro1234 commented 5 years ago
[ 20%] Building CXX object wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxlua/wxlconsole.cpp.obj
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\x86_64-8.1.0-release-posix-seh-rt_v6
-rev0\mingw64\bin\g++.exe  -DUNICODE -DWXMAKINGDLL_LUAMODULE -D_UNICODE -DwxLUA_USEBINDING_WXADV=1 -DwxLUA_USEBINDING_WXAUI=1
 -DwxLUA_USEBINDING_WXBASE=1 -DwxLUA_USEBINDING_WXCORE=1 -DwxLUA_USEBINDING_WXGL=1 -DwxLUA_USEBINDING_WXHTML=1 -DwxLUA_USEBIN
DING_WXMEDIA=0 -DwxLUA_USEBINDING_WXNET=1 -DwxLUA_USEBINDING_WXPROPGRID=0 -DwxLUA_USEBINDING_WXRICHTEXT=0 -DwxLUA_USEBINDING_
WXSTC=1 -DwxLUA_USEBINDING_WXWEBVIEW=0 -DwxLUA_USEBINDING_WXXML=0 -DwxLUA_USEBINDING_WXXRC=0 -DwxUSE_UNICODE=1 @CMakeFiles/wx
LuaModule.dir/includes_CXX.rsp -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DNDEBUG   -Wno-deprecated-declarations
 -o CMakeFiles\wxLuaModule.dir\__\wxlua\wxlconsole.cpp.obj -c C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wx
lconsole.cpp
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wxlconsole.cpp: In function 'void wxlua_RedirectIOToDosConsole(b
ool, short int)':
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wxlconsole.cpp:329:54: error: cast from 'HANDLE' {aka 'void*'} t
o 'long int' loses precision [-fpermissive]
     lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
                                                      ^
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wxlconsole.cpp:335:53: error: cast from 'HANDLE' {aka 'void*'} t
o 'long int' loses precision [-fpermissive]
     lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE);
                                                     ^
C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wxlconsole.cpp:341:53: error: cast from 'HANDLE' {aka 'void*'} t
o 'long int' loses precision [-fpermissive]
     lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
                                                     ^
In file included from C:\supercolliderrepos\wxLuaBundled\wxlua\wxLua\modules\wxlua\wxlconsole.cpp:29:
C:/supercolliderrepos/wxLuaBundled/wxlua/wxLua/art/wxlua.xpm: At global scope:
C:/supercolliderrepos/wxLuaBundled/wxlua/wxLua/art/wxlua.xpm:2:21: warning: 'LUA_xpm' defined but not used [-Wunused-variable
]
 static const char * LUA_xpm[] = {
                     ^~~~~~~
pkulchenko commented 5 years ago

@sonoro1234, thank you for the feedback; one more update now to the console module for the fix.

sonoro1234 commented 5 years ago

linking error now

[ 11%] Linking CXX shared library ..\..\..\..\bin\Release\wx.dll
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\cmake-3.13.0-rc1-win64-x64\bin\cmake
.exe -E cmake_link_script CMakeFiles\wxLuaModule.dir\link.txt --verbose=1
C:\cmake-3.13.0-rc1-win64-x64\bin\cmake.exe -E remove -f CMakeFiles\wxLuaModule.dir/objects.a
C:\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin\ar.exe cr CMakeFiles\wxLuaModule.dir/objects.a @CMakeFiles\wxLuaModu
le.dir\objects1.rsp
C:\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe  -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DND
EBUG  -shared -o ..\..\..\..\bin\Release\wx.dll -Wl,--out-implib,..\..\..\..\lib\Release\libwx.dll.a -Wl,--major-image-versio
n,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\wxLuaModule.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\wxLua
Module.dir\linklibs.rsp
C:/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/l
ib/../lib/libuuid.a(lib64_libuuid_a-uuid.o):uuid.c:(.rdata$IID_IAccessible[IID_IAccessible]+0x0): multiple definition of `IID
_IAccessible'
C:/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/l
ib/../lib/liboleacc.a(diqfs00017.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [wxlua\wxLua\modules\luamodule\CMakeFiles\wxLuaModule.dir\build.make:912: bin/Release/wx.dll] Error 1
mingw32-make[2]: Leaving directory 'C:/supercolliderrepos/build_wxLuaBundled312_64'
mingw32-make[1]: *** [CMakeFiles\Makefile2:419: wxlua/wxLua/modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
mingw32-make[1]: Leaving directory 'C:/supercolliderrepos/build_wxLuaBundled312_64'

And another issue already present before: I had to run cmake twice for finding wxWidgets, the first time it says:

-- * Using these wxWidgets components: stc;scintilla;gl;html;aui;adv;core;net;base
-- Could NOT find wxWidgets (missing:  wxWidgets_FOUND)
-- *
CMake Warning at wxlua/wxLua/build/CMakewxAppLib.cmake:336 (message):
  * WARNING: Could not find wxWidgets! Please see help above.
Call Stack (most recent call first):
  wxlua/wxLua/CMakeLists.txt:58 (FIND_WXWIDGETS)

-- * - wxWidgets_VERSION           = 3.1.3 = 3.1.3
-- * - wxWidgets_COMPONENTS        = stc;scintilla;gl;html;aui;adv;core;net;base
-- * - wxWidgets_INCLUDE_DIRS      =
-- * - wxWidgets_LIBRARY_DIRS      = wxWidgets_LIB_DIR-NOTFOUND
-- * - wxWidgets_LIBRARIES         =
-- * - wxWidgets_CXX_FLAGS         =
-- * - wxWidgets_DEFINITIONS       =
-- * - wxWidgets_DEFINITIONS_DEBUG =
-- * - wxWidgets_PORTNAME          =
-- * - wxWidgets_UNIVNAME          =
-- * - wxWidgets_UNICODEFLAG       =
-- * - wxWidgets_DEBUGFLAG         =
 WARNING: Unable to find requested wxWidgets component : stc
 WARNING: Unable to find requested wxWidgets component : scintilla
 WARNING: Unable to find requested wxWidgets component : gl
 WARNING: Unable to find requested wxWidgets component : html
 WARNING: Unable to find requested wxWidgets component : aui
 WARNING: Unable to find requested wxWidgets component : adv
 WARNING: Unable to find requested wxWidgets component : core
 WARNING: Unable to find requested wxWidgets component : net
 WARNING: Unable to find requested wxWidgets component : base
pkulchenko commented 5 years ago

@sonoro1234, regarding the first (linking) issue. This doesn't seem to be a wxlua problem, but rather msys2/mingw packaging problem. See the discussion here and proposed solutions here and here (this one is for different symbols, but I think the same removal can be done for IID_IAccessible). Can you try the first of the solutions (adding -Wl,--allow-multiple-definition) to see if it helps or if anything else comes up.

Regarding the second one, I'm not sure why it's coming up; I've seen it happening, but haven't had a chance to investigate. It doesn't happen if you run git checkout . before building in wxlua folder, so appears to be some conflict with leftover build files.

sonoro1234 commented 5 years ago

I will tell you the result when being able to try it!

pkulchenko commented 5 years ago

@sonoro1234, I've been able to compile on Windows using 64bit mingw and didn't run into the linker issue you showed. Take a look at the suggested solutions, but the issue may be specific to your version of mingw. Also make sure that you run make clean and git clean -fd in both wxwidgets and wxlua, as I ran into the issue of some leftovers from previous builds that were affecting subsequent builds.

pkulchenko commented 5 years ago

@sonoro1234, I pushed one more commit that switched all types to using wxIntPtr and wxUIntPtr into https://github.com/pkulchenko/wxlua/tree/ptrdiff. I tested these changes with both 32bit and 64bit builds on Windows and so far everything looks good. Give them a try and let me know, as I plan to merge these changes into wxwidgets312 branch.

sonoro1234 commented 5 years ago

It seems that I am not able to set this linker options correctly

[  2%] Linking CXX shared library ..\..\..\..\bin\Release\wx.dll
cd /d C:\supercolliderrepos\build_wxLuaBundled312_64\wxlua\wxLua\modules\luamodule && C:\cmake-3.13.0-rc1-win64-x64\bin\cmake
.exe -E cmake_link_script CMakeFiles\wxLuaModule.dir\link.txt --verbose=1
C:\cmake-3.13.0-rc1-win64-x64\bin\cmake.exe -E remove -f CMakeFiles\wxLuaModule.dir/objects.a
C:\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin\ar.exe cr CMakeFiles\wxLuaModule.dir/objects.a @CMakeFiles\wxLuaModu
le.dir\objects1.rsp
C:\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe  -DLUA_COMPAT_MODULE -DwxDEBUG_LEVEL=0  -Wall -fPIC -O3 -DND
EBUG -Wl --allow-multiple-definition -shared -o ..\..\..\..\bin\Release\wx.dll -Wl,--out-implib,..\..\..\..\lib\Release\libwx
.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\wxLuaModule.dir/objects.a -Wl,--no-
whole-archive @CMakeFiles\wxLuaModule.dir\linklibs.rsp
g++.exe: error: unrecognized command line option '-Wl'; did you mean '-W'?
g++.exe: error: unrecognized command line option '--allow-multiple-definition'; did you mean '-Wold-style-definition'?
pkulchenko commented 5 years ago

Replace space with a comma: -Wl --allow-multiple-definition should be -Wl,--allow-multiple-definition. Similar to how it shows -Wl,--whole-archive later in the same command.

sonoro1234 commented 5 years ago

Thanks!! That worked!!

pkulchenko commented 5 years ago

Good; thank you for the update. I'm still not sure why it's needed, but I'll keep this info in the ticket in case someone else runs into the same problem.

Can you show the actual cmake command you executed with that option?

sonoro1234 commented 5 years ago
"cmake"  -G"MinGW Makefiles"  -DCMAKE_BUILD_TYPE="Release"  -DLUA_INCLUDE_DIR="C:/luaGL/sources/lua-5.1.5/src" -DLUA_LIBRARY="C:/anima64/Lua51.dll" -DLUAJIT_BIN="installwxlua" ../wxLuaBundled

I didn't managed to set this flags on the cmake command line, I had to modify cmake file in wxLua

pkulchenko commented 5 years ago

Got it; can you include the diff then?

sonoro1234 commented 5 years ago

(replaced link with the actual diff)

diff --git a/wxLua/modules/CMakeLists.txt b/wxLua/modules/CMakeLists.txt
index 054df26..81d53b1 100644
--- a/wxLua/modules/CMakeLists.txt
+++ b/wxLua/modules/CMakeLists.txt
@@ -588,6 +588,9 @@ ADD_LIBRARY_FULL( wxLuaModule SHARED # ALLOW_MISSING_FILES
         set_property(TARGET wxLuaModule APPEND PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
     endif()

+   if(MINGW)
+       target_link_options(wxLuaModule PUBLIC "-Wl,--allow-multiple-definition")
+   endif()
 # Don't let CMake prepend "lib" on wx.dll with MingW
 if ("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
     set_target_properties(wxLuaModule PROPERTIES PREFIX "")

only applyied to wxLuaModule (as is the only target I am building) Perhaps only should be used in 64 bits and not 32bits

pkulchenko commented 5 years ago

@sonoro1234, can you try this patch (I reformatted things slightly):

diff --git a/wxLua/modules/CMakeLists.txt b/wxLua/modules/CMakeLists.txt
index 054df26..5f7baee 100644
--- a/wxLua/modules/CMakeLists.txt
+++ b/wxLua/modules/CMakeLists.txt
@@ -549,8 +549,6 @@ function (wxLua_Modules_LuaModule_TARGETS)
 # This is always built as a DLL
 set( WXLUAMODULE_PROPERTIES_DEFINE_SYMBOL PROPERTIES DEFINE_SYMBOL WXMAKINGDLL_LUAMODULE)

-
-
 # Build from fresh sources so we have a clean stand-alone Lua module and
 # we get all the DLL exports right.
 if(WIN32)
@@ -581,12 +579,16 @@ ADD_LIBRARY_FULL( wxLuaModule SHARED # ALLOW_MISSING_FILES
     PROPERTIES FOLDER "wxLua/Modules"
     INSTALL "${WXLUA_LIB_INSTALL_FLAGS_NO_EXPORT}")

-    # Silence the deprecated warnings since there isn't much we can do about them.
-    if (MSVC)
-        set_property(TARGET wxLuaModule APPEND PROPERTY COMPILE_FLAGS "/wd4996")
-    elseif (CMAKE_COMPILER_IS_GNUCXX)
-        set_property(TARGET wxLuaModule APPEND PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
-    endif()
+# Silence the deprecated warnings since there isn't much we can do about them.
+if (MSVC)
+    set_property(TARGET wxLuaModule APPEND PROPERTY COMPILE_FLAGS "/wd4996")
+elseif (CMAKE_COMPILER_IS_GNUCXX)
+    set_property(TARGET wxLuaModule APPEND PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
+endif()
+
+if(MINGW)
+    target_link_options(wxLuaModule PUBLIC "-Wl,--allow-multiple-definition")
+endif()

 # Don't let CMake prepend "lib" on wx.dll with MingW
 if ("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
pkulchenko commented 5 years ago

Closing, as this should be all fixed now.