Opened 6 months ago

Closed 6 months ago

#18718 closed build error (fixed)

wxTEST_STL failed

Reported by: schneeregenflocke Owned by: Vadim Zeitlin <vadim@…>
Priority: normal Milestone: 3.1.4
Component: build Version: stable-latest
Keywords: wxTEST_STL Cc: schneeregenflocke@…
Blocked By: Blocking:
Patch: no

Description

If c++17 is used to build set(CMAKE_CXX_STANDARD 17), a FATAL_ERROR Can't use wxUSE_STL as basic STL functionality is missing is generated in https://github.com/wxWidgets/wxWidgets/blob/master/build/cmake/setup.cmake#L156. This is probably because std::bind2nd(std::less<int>(), 3)); has been removed since c++17, see https://en.cppreference.com/w/cpp/utility/functional/bind12.

Change History (6)

comment:1 Changed 6 months ago by vadz

  • Milestone set to 3.1.4
  • Status changed from new to confirmed

Thanks for reporting, this should indeed be fixed.

For CMake part, we could just remove this part of the compilation test or put it inside __cplusplus < 201703L check, I guess. We also need to update the code in src/common/arrstr.cpp to not use it any longer, which is more annoying as we can't use lambdas for as long as we still support C++98 build.

comment:2 follow-up: Changed 6 months ago by MaartenB

I think wxBUILD_CXX_STANDARD should also be changed, it is only applied to the build targets and not used when performing tests.

src/common/arrstr.cpp already has a fix using #if __cplusplus >= 201103L or do you mean additional fixes?

I can create a PR with the CMake fixes. Configure uses the same check, should this be updated as well?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 6 months ago by vadz

Replying to MaartenB:

I think wxBUILD_CXX_STANDARD should also be changed, it is only applied to the build targets and not used when performing tests.

I could be completely wrong, but with configure it's best to use the same compilation flags for the tests and the actual code to avoid any weird discrepancies.

src/common/arrstr.cpp already has a fix using #if __cplusplus >= 201103L or do you mean additional fixes?

Oops, sorry, I just grepped for it and found this code but didn't notice it was in #else branch of this #if. You're right, there doesn't seem to be anything to do here.

I can create a PR with the CMake fixes. Configure uses the same check, should this be updated as well?

And I didn't realize that configure used this check as well -- it definitely needs to be updated too, thanks!

I suspect that actually this test is not needed any more, so maybe it could be removed completely instead of updating it, but I'm not 100% sure about this...

comment:4 in reply to: ↑ 3 Changed 6 months ago by MaartenB

I could be completely wrong, but with configure it's best to use the same compilation flags for the tests and the actual code to avoid any weird discrepancies.


Yes, that is what CMake should do as well.

And I didn't realize that configure used this check as well -- it definitely needs to be updated too, thanks!


In configure it was already in a not HAVE_CXX11 check, so nothing to change there.

I suspect that actually this test is not needed any more, so maybe it could be removed completely instead of updating it, but I'm not 100% sure about this...


I'll leave them for now, I created https://github.com/wxWidgets/wxWidgets/pull/1782 with the fixes.

comment:5 Changed 6 months ago by schneeregenflocke

  • Cc schneeregenflocke@… added

Thanks, that went faster than I thought.

comment:6 Changed 6 months ago by Vadim Zeitlin <vadim@…>

  • Owner set to Vadim Zeitlin <vadim@…>
  • Resolution set to fixed
  • Status changed from confirmed to closed

In 413fdfbfa/git-wxWidgets:

Merge branch 'cmake-c++11-stl' of git://github.com/MaartenBent/wxWidgets

CMake: Improve STL checks, improve C++17/20 support.

See https://github.com/wxWidgets/wxWidgets/pull/1782

Closes #18718.

Note: See TracTickets for help on using tickets.