Skip to content

build: Check supported C++ standard features and user setting#27107

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
Kumataro:fix27105
Mar 31, 2025
Merged

build: Check supported C++ standard features and user setting#27107
asmorkalov merged 3 commits intoopencv:4.xfrom
Kumataro:fix27105

Conversation

@Kumataro
Copy link
Copy Markdown
Contributor

Close #27105

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@Kumataro
Copy link
Copy Markdown
Contributor Author

After fixing, cmake -DCMAKE_CXX_STANDRD=98 reports error about C++ standard.

kmtr@kmtr-VMware-Virtual-Platform:~/work$ cmake -S opencv4 -B build4-main.CXX98 -DCMAKE_CXX_STANDARD=98 -GNinja
-- 'Release' build type is used by default. Use CMAKE_BUILD_TYPE to specify build type (Release or Debug)
-- The CXX compiler identification is GNU 13.3.0
-- The C compiler identification is GNU 13.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detected processor: x86_64
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:239 (message):
  OpenCV 4.x requires C++11 features, but your configuration does not enable
  it
Call Stack (most recent call first):
  CMakeLists.txt:189 (include)


-- Configuring incomplete, errors occurred!

@asmorkalov asmorkalov merged commit 09c71ae into opencv:4.x Mar 31, 2025
49 of 55 checks passed
@asmorkalov asmorkalov mentioned this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: C++ standard checker does not work with C++11 supported compiler

3 participants