Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous overload errors with wxWidgets 3.2.4 #11768

Open
2 tasks
onitake opened this issue Nov 27, 2023 · 0 comments · May be fixed by #11769
Open
2 tasks

Ambiguous overload errors with wxWidgets 3.2.4 #11768

onitake opened this issue Nov 27, 2023 · 0 comments · May be fixed by #11769

Comments

@onitake
Copy link

onitake commented Nov 27, 2023

Description of the bug

PrusaSlicer fails to compile with wxWidgets 3.2.4, due to the introduction of initializer list constructors in wxArrayString.

Upstream issue: wxWidgets/wxWidgets#24093
They mention that the changes were intentional and won't be pulled back, so changes will be needed in the PrusaSlicer source code.

This bug was discovered during the last Debian package rebuild: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056897

I've posted a simple patch that adds explicit std::vector intermediates, but it would probably be better to refactor the source code. The wxWidgets developers apparently want to deprecate wxArrayString and other convenience types, as mentioned here: wxWidgets/wxWidgets@4d62df4
I can submit the patch as a PR if needed.
Refactoring may result in breaking changes, so it's probably better to hold off until the next major wxWidgets release.

Project file & How to reproduce

  1. Compile PrusaSlicer against wxWidgets 3.2.4 or newer (tested with gcc 13.2.0)
  2. Failure:
src/slic3r/GUI/Plater.cpp: In member function ‘void Slic3r::GUI::Plater::load_project(const wxString&)’:
src/slic3r/GUI/Plater.cpp:5313:21: error: call of overloaded ‘load_files(<brace-enclosed initializer list>)’ is ambiguous
 5313 |     if (! load_files({ into_path(filename) }).empty()) {
      |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/slic3r/GUI/Plater.cpp:20:
src/slic3r/GUI/Plater.hpp:193:25: note: candidate: ‘std::vector<long unsigned int> Slic3r::GUI::Plater::load_files(const std::vector<boost::filesystem::path>&, bool, bool, bool)’
  193 |     std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, bool load_model = true, bool load_config = true, bool imperial_units = false);
      |                         ^~~~~~~~~~
src/slic3r/GUI/Plater.hpp:197:10: note: candidate: ‘bool Slic3r::GUI::Plater::load_files(const wxArrayString&, bool)’
  197 |     bool load_files(const wxArrayString& filenames, bool delete_after_load = false);
      |          ^~~~~~~~~~

and

src/slic3r/GUI/PhysicalPrinterDialog.cpp: In member function 'void Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(Slic3r::GUI::ConfigOptionsGroup*)':
src/slic3r/GUI/PhysicalPrinterDialog.cpp:465:27: error: call of overloaded 'set_values(<brace-enclosed initializer list>)' is ambiguous
  465 |         choice->set_values({ m_config->opt_string("printhost_port") });
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/slic3r/GUI/ConfigManipulation.hpp:16,
                 from src/slic3r/GUI/Tab.hpp:50,
                 from src/slic3r/GUI/PhysicalPrinterDialog.cpp:28:
src/slic3r/GUI/Field.hpp:381:33: note: candidate: 'void Slic3r::GUI::Choice::set_values(const std::vector<std::__cxx11::basic_string<char> >&)'
  381 |         void                    set_values(const std::vector<std::string> &values);
      |                                 ^~~~~~~~~~
src/slic3r/GUI/Field.hpp:382:33: note: candidate: 'void Slic3r::GUI::Choice::set_values(const wxArrayString&)'
  382 |         void                    set_values(const wxArrayString &values);
      |                                 ^~~~~~~~~~

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

2.6.1

Operating system

Debian sid

Printer model

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant