haxeui / hxWidgets

Haxe externs (and wrappers) for wxWidgets
MIT License
78 stars 23 forks source link

A bunch of "undefined reference to ......" when building, failing the build #84

Closed MeowcaTheoRange closed 2 years ago

MeowcaTheoRange commented 2 years ago

Expected Behavior

Build. Should run! Like normal!

Current Behavior

..@..: $ haxe hxwidgets.hxml
haxelib run hxcpp Build.xml haxe -DABI="-MD" -DNO_PRECOMPILED_HEADERS="1" -DPLATFORM_OTHER="1" -DWXSTATIC="1" -Dhaxe="4.2.4" -Dhaxe3="1" -Dhaxe4="1" -Dhaxe_ver="4.204" -Dhaxeui-core="1.4.0" -Dhaxeui-hxwidgets="1.4.0" -Dhaxeui_core="1.4.0" -Dhaxeui_hxwidgets="1.4.0" -DhxWidgets="1.9.0" -Dhxcpp="4.2.1" -Dhxcpp_api_level="400" -Dhxcpp_smart_strings="1" -Dsource_header="Generated by Haxe 4.2.4" -Dstatic="1" -Dtarget.name="cpp" -Dtarget.static="true" -Dtarget.sys="true" -Dtarget.threaded="true" -Dtarget.unicode="true" -Dtarget.utf16="true" -Dutf16="1" -I"/home/theorange/haxelib/hxcpp/4,2,1/" -I"/home/theorange/haxelib/hxWidgets/1,9,0/src/" -I"/home/theorange/haxelib/haxeui-hxwidgets/1,4,0/" -I"/home/theorange/haxelib/haxeui-core/1,4,0/" -I"src/" -I"" -I"/usr/lib/haxe/extraLibs/" -I"/usr/share/haxe/extraLibs/" -I"/usr/bin/extraLibs/" -I"/usr/lib/haxe/std/cpp/_std/" -I"/usr/share/haxe/std/cpp/_std/" -I"/usr/bin/std/cpp/_std/" -I"/usr/lib/haxe/std/" -I"/usr/share/haxe/std/" -I"/usr/bin/std/"
Link: Main
/usr/bin/ld: obj/linux64/edf3cd3c_SystemOptions.o: in function `hx::widgets::SystemOptions_obj::getOption(String)':
SystemOptions.cpp:(.text+0x72d): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_SystemOptions.o: in function `hx::widgets::SystemOptions_obj::setOption(String, int)':
SystemOptions.cpp:(.text+0x911): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_SystemOptions.o: in function `hx::widgets::SystemOptions_obj::getOption(String) [clone .cold]':
SystemOptions.cpp:(.text.unlikely+0x34): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_SystemOptions.o: in function `hx::widgets::SystemOptions_obj::setOption(String, int) [clone .cold]':
SystemOptions.cpp:(.text.unlikely+0x84): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_CheckBox.o: in function `hx::widgets::CheckBox_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, hx::Null<int>, hx::Null<int>)':
CheckBox.cpp:(.text+0x70c): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_CheckBox.o:CheckBox.cpp:(.text.unlikely+0x4c): more undefined references to `wxMBConv::~wxMBConv()' follow
/usr/bin/ld: obj/linux64/edf3cd3c_ComboBox.o: in function `hx::widgets::ComboBox_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, hx::Null<int>, hx::Null<int>)':
ComboBox.cpp:(.text+0xb01): undefined reference to `wxBaseArrayPtrVoid::wxBaseArrayPtrVoid()'
/usr/bin/ld: obj/linux64/edf3cd3c_ComboBox.o: in function `hx::widgets::ComboBox_obj::getString(int) [clone .cold]':
ComboBox.cpp:(.text.unlikely+0x38): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_ComboBox.o: in function `hx::widgets::ComboBox_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, hx::Null<int>, hx::Null<int>) [clone .cold]':
ComboBox.cpp:(.text.unlikely+0x96): undefined reference to `wxBaseArrayPtrVoid::~wxBaseArrayPtrVoid()'
/usr/bin/ld: obj/linux64/edf3cd3c_TaskBarIcon.o: in function `hx::widgets::TaskBarIcon_obj::setBitmap(hx::ObjectPtr<hx::widgets::Bitmap_obj>, String)':
TaskBarIcon.cpp:(.text+0x915): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_TaskBarIcon.o: in function `hx::widgets::TaskBarIcon_obj::setIcon(hx::ObjectPtr<hx::widgets::Icon_obj>, String)':
TaskBarIcon.cpp:(.text+0xb5a): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_TaskBarIcon.o: in function `hx::widgets::TaskBarIcon_obj::setBitmap(hx::ObjectPtr<hx::widgets::Bitmap_obj>, String) [clone .cold]':
TaskBarIcon.cpp:(.text.unlikely+0x75): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_TaskBarIcon.o: in function `hx::widgets::TaskBarIcon_obj::setIcon(hx::ObjectPtr<hx::widgets::Icon_obj>, String) [clone .cold]':
TaskBarIcon.cpp:(.text.unlikely+0xc6): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_PasswordEntryDialog.o: in function `hx::widgets::PasswordEntryDialog_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, String, String, hx::Null<int>)':
PasswordEntryDialog.cpp:(.text+0x539): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_PasswordEntryDialog.o:PasswordEntryDialog.cpp:(.text+0x61c): more undefined references to `wxMBConv::~wxMBConv()' follow
/usr/bin/ld: obj/linux64/edf3cd3c_PasswordEntryDialog.o: in function `hx::widgets::PasswordEntryDialog_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, String, String, hx::Null<int>)':
PasswordEntryDialog.cpp:(.text+0x752): undefined reference to `wxPasswordEntryDialog::wxPasswordEntryDialog(wxWindow*, wxString const&, wxString const&, wxString const&, long, wxPoint const&)'
/usr/bin/ld: obj/linux64/edf3cd3c_PasswordEntryDialog.o: in function `hx::widgets::PasswordEntryDialog_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, String, String, hx::Null<int>) [clone .cold]':
PasswordEntryDialog.cpp:(.text.unlikely+0x3f): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: PasswordEntryDialog.cpp:(.text.unlikely+0xb7): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: PasswordEntryDialog.cpp:(.text.unlikely+0xf9): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_MessageDialog.o: in function `hx::widgets::MessageDialog_obj::__construct(hx::ObjectPtr<hx::widgets::Window_obj>, String, String, hx::Null<int>)':
MessageDialog.cpp:(.text+0x56f): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: MessageDialog.cpp:(.text+0x64e): undefined reference to `wxMBConv::~wxMBConv()'
/usr/bin/ld: obj/linux64/edf3cd3c_MessageDialog.o:MessageDialog.cpp:(.text.unlikely+0x3a): more undefined references to `wxMBConv::~wxMBConv()' follow
collect2: error: ld returned 1 exit status
Error: Build failed

Steps to Reproduce (for bugs)

  1. Install wxwidgets using latest source build (make)
  2. Install haxeui-core and required dependencies for native building
  3. Setup template for native building
  4. Run haxe hxwidgets.hxml and Watch It Fail

Context

Trying to Use HaxeUI just to do something. Anything At All

Your Environment

ianharrigan commented 2 years ago

Can you try git versions of haxeui:

haxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib git haxeui-hxwidgets https://github.com/haxeui/haxeui-hxwidgets
haxelib git hxWidgets https://github.com/haxeui/hxWidgets

You may need to clean our your build folder, if that doesnt work, you might need to use git version of wxWidgets, though im guessing 3.1.7 is late enough

MeowcaTheoRange commented 2 years ago

It seems there is an error in the current haxeui-hxwidgets git release:

../haxelib/haxeui-hxwidgets/git/haxe/ui/backend/hxwidgets/custom/SimpleListView.hx:20: characters 16-29 : Redefinition of variable selectedIndex in subclass is not allowed. Previously declared at hx.widgets.ListCtrl

Reverting haxeui-hxwidgets to 1.4.0 gets me:

Error: ./src/hx/widgets/TaskBarIcon.cpp: In member function ‘void hx::widgets::TaskBarIcon_obj::setIcon(hx::widgets::Icon, String)’:
./src/hx/widgets/TaskBarIcon.cpp:86:46: error: cannot convert ‘wxIcon’ to ‘const wxBitmapBundle&’
   86 | HXDLIN(  27)            (*(_hx_tmp)).SetIcon(_hx_tmp1,_hx_tmp2);
      |                                              ^~~~~~~~
      |                                              |
      |                                              wxIcon
In file included from /usr/local/include/wx-3.1/wx/taskbar.h:89,
                 from ./src/hx/widgets/TaskBarIcon.cpp:17:
/usr/local/include/wx-3.1/wx/gtk/taskbar.h:18:48: note:   initializing argument 1 of ‘virtual bool wxTaskBarIcon::SetIcon(const wxBitmapBundle&, const wxString&)’
   18 |     virtual bool SetIcon(const wxBitmapBundle& icon, const wxString& tooltip = wxString()) wxOVERRIDE;
      |                          ~~~~~~~~~~~~~~~~~~~~~~^~~~
./src/hx/widgets/TaskBarIcon.cpp: In member function ‘void hx::widgets::TaskBarIcon_obj::setBitmap(hx::widgets::Bitmap, String)’:
./src/hx/widgets/TaskBarIcon.cpp:108:46: error: cannot convert ‘wxIcon’ to ‘const wxBitmapBundle&’
  108 | HXDLIN(  48)            (*(_hx_tmp)).SetIcon(_hx_tmp1,_hx_tmp2);
      |                                              ^~~~~~~~
      |                                              |
      |                                              wxIcon
In file included from /usr/local/include/wx-3.1/wx/taskbar.h:89,
                 from ./src/hx/widgets/TaskBarIcon.cpp:17:
/usr/local/include/wx-3.1/wx/gtk/taskbar.h:18:48: note:   initializing argument 1 of ‘virtual bool wxTaskBarIcon::SetIcon(const wxBitmapBundle&, const wxString&)’
   18 |     virtual bool SetIcon(const wxBitmapBundle& icon, const wxString& tooltip = wxString()) wxOVERRIDE;
      |                          ~~~~~~~~~~~~~~~~~~~~~~^~~~
Error: Build failed
ianharrigan commented 2 years ago

Are you sure you have latest haxeui-hxwidgets (git version), the selectedIndex was removed from SimpleListView in 2020: https://github.com/haxeui/haxeui-hxwidgets/commit/1efc9b2f840b55e723c31edd004afb6768b01ce9

You might need to nuke all your haxelibs and start again (from git), looks / feels like haxelib has screwed something up as there is defo no line 20 in SimpleListView.hx

MeowcaTheoRange commented 2 years ago

Well that absolutely worked, thank you! However, now there's another problem re-running the code you gave me...

wxWidgets version detected as 3.1.7
../haxelib/haxeui-hxwidgets/git/haxe/ui/backend/hxwidgets/behaviours/ControlDisable.hx:18: characters 20-44 : haxe.ui.core.Component has no field disableInteractiveEvents (Suggestions: isInteractiveEvent, disableInteractivity)
MeowcaTheoRange commented 2 years ago

Perhaps it's because it's force-downgrading core to meet its' dependencies, so I'm going to revert and upgrade haxeui-core

ianharrigan commented 2 years ago

So yeah, it seems like haxelib has screwed up some thing... it seems to happen from time to time, my advice: nuke haxeui-* folders from haxelib (just delete them from the haxelib folder in your haxe install, do the same for hxWidgets), then run:

haxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib git haxeui-hxwidgets https://github.com/haxeui/haxeui-hxwidgets
haxelib git hxWidgets https://github.com/haxeui/hxWidgets

Hopefully it will get it right this time

MeowcaTheoRange commented 2 years ago

This worked! I re-upgraded haxeui-core to git and now this is what I have to say to you: image

ianharrigan commented 2 years ago

No worries, glad it worked in the end. :)