Skip to content

Test C++11 code on GHA with C++98 config.#1926

Closed
s-trinh wants to merge 5 commits intolagadic:masterfrom
s-trinh:repro_issue_cpp98_GHA
Closed

Test C++11 code on GHA with C++98 config.#1926
s-trinh wants to merge 5 commits intolagadic:masterfrom
s-trinh:repro_issue_cpp98_GHA

Conversation

@s-trinh
Copy link
Contributor

@s-trinh s-trinh commented Mar 13, 2026

There seems to be an issue with C++98 builds when ur_rtde is built:

    - name: Install ur_rtde dependency
      run: |
        sudo add-apt-repository -y ppa:sdurobotics/ur-rtde
        sudo apt-get update
        sudo apt install -y librtde librtde-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev
  • first commit:
    • there are C++11 code both in the ViSP library and in ‎apps/calibration/intrinsic/visp-calibrate-camera.cpp
    • the ViSP library builds fine
    • running visp-calibrate-camera gives:
    Compiler with C++11 support is required.
    ptr=5
    C++11 code in vpMath::isInf())
    ptr=50
    • meaning VISP_CXX_STANDARD is correctly set (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
    • but ViSP is actually built with C++11 flag

cf the raw log where -std=c++11 flag is passed:

2026-03-13T12:12:15.9307144Z [ 81%] Building CXX object modules/robot/CMakeFiles/visp_robot.dir/src/wireframe-simulator/vpVwstack.cpp.o
2026-03-13T12:12:15.9320323Z cd /home/runner/work/visp/visp/build/modules/robot && /usr/bin/g++ -Dvisp_EXPORTS -I/home/runner/work/visp/visp/build/include -I/home/runner/work/visp/visp/modules/robot/include -I/home/runner/work/visp/visp/modules/robot/src -I/home/runner/work/visp/visp/build/modules/robot -I/home/runner/work/visp/visp/modules/core/include -I/home/runner/work/visp/visp/modules/gui/include -I/home/runner/work/visp/visp/modules/io/include -I/home/runner/work/visp/visp/modules/sensor/include -isystem /usr/include/eigen3 -isystem /usr/include/libusb-1.0 -Wall -Wextra -Wno-c++11-compat -Wno-c++0x-compat -fopenmp -fvisibility=hidden -fvisibility-inlines-hidden -msse2 -msse3 -mssse3 -fPIC -O3 -DNDEBUG -std=c++11 -fPIC -MD -MT modules/robot/CMakeFiles/visp_robot.dir/src/wireframe-simulator/vpVwstack.cpp.o -MF CMakeFiles/visp_robot.dir/src/wireframe-simulator/vpVwstack.cpp.o.d -o CMakeFiles/visp_robot.dir/src/wireframe-simulator/vpVwstack.cpp.o -c /home/runner/work/visp/visp/modules/robot/src/wireframe-simulator/vpVwstack.cpp
  • second commit:
    • removal of ur_rtde
    • ViSP build correctly failed

@s-trinh s-trinh force-pushed the repro_issue_cpp98_GHA branch from 185e741 to 5d592da Compare March 13, 2026 12:07
@fspindle
Copy link
Contributor

@s-trinh The following error with Apriltag (link to GHA) line 1957

cd /home/runner/work/visp/visp/build/modules/detection && /usr/bin/g++ -Dvisp_EXPORTS -I/home/runner/work/visp/visp/build/include -I/home/runner/work/visp/visp/modules/detection/include -I/home/runner/work/visp/visp/modules/detection/src -I/home/runner/work/visp/visp/build/modules/detection -I/home/runner/work/visp/visp/modules/core/include -I/home/runner/work/visp/visp/modules/io/include -I/home/runner/work/visp/visp/modules/tracker/me/include -I/home/runner/work/visp/visp/modules/tracker/blob/include -I/home/runner/work/visp/visp/modules/visual_features/include -I/home/runner/work/visp/visp/modules/vision/include -isystem /usr/include/eigen3 -isystem /usr/include/apriltag -Wall -Wextra -Wno-c++11-compat -Wno-c++0x-compat -fopenmp -fvisibility=hidden -fvisibility-inlines-hidden -msse2 -msse3 -mssse3 -fPIC -O3 -DNDEBUG -std=c++98 -fPIC -MD -MT modules/detection/CMakeFiles/visp_detection.dir/src/tag/vpDetectorAprilTag.cpp.o -MF CMakeFiles/visp_detection.dir/src/tag/vpDetectorAprilTag.cpp.o.d -o CMakeFiles/visp_detection.dir/src/tag/vpDetectorAprilTag.cpp.o -c /home/runner/work/visp/visp/modules/detection/src/tag/vpDetectorAprilTag.cpp
/home/runner/work/visp/visp/modules/detection/src/tag/vpDetectorAprilTag.cpp: In static member function ‘static vpDetectorAprilTag::vpAprilTagFamily vpDetectorAprilTag::tagFamilyFromString(const std::string&)’:
/home/runner/work/visp/visp/modules/detection/src/tag/vpDetectorAprilTag.cpp:1531:66: error: ‘vpDetectorAprilTag::vpAprilTagFamily’ is not a class or namespace
 1531 |   vpDetectorAprilTag::vpAprilTagFamily res = vpDetectorAprilTag::vpAprilTagFamily::TAG_COUNT;
      |                                                                  ^~~~~~~~~~~~~~~~                                                               ^~~~~~~~~~~~~~~~

is fixed in PR #1927, with commit 572d511

Having this error means for me that the build is in cxx98 and not cxx11. This is confirmed with the option -std=c++98 that is used.

@s-trinh
Copy link
Contributor Author

s-trinh commented Mar 13, 2026

Commit 2 and 3 here are without ur_rtde. That's why the build successfully failed.

The C++98 builds should have failed long time ago.


Commit 1: everything passed but should not. I even put C++11 code directly in vpMath to make it fail. But the build still succeeded.

The log: https://github.com/lagadic/visp/actions/runs/23050111741/job/66948887696

Gives plenty of std=c++11 flag:

image

@fspindle
Copy link
Contributor

@s-trinh I agree that there is something weird.

With visp-3.6.0 when -DUSE_CXX_STANDARD=98 -DUSE_EIGEN3=OFF -DUSE_PCL=OFF -DUSE_OPENCV=OFF the -std=c++11 flag is not used.

Some changes were introduced...

@fspindle
Copy link
Contributor

@s-trinh Should be fixed in PR #1927, see issue #1929

@s-trinh s-trinh force-pushed the repro_issue_cpp98_GHA branch from 6ef8a92 to 87d3c83 Compare March 16, 2026 09:42
@s-trinh
Copy link
Contributor Author

s-trinh commented Mar 16, 2026

@fspindle
Thanks, the issue is solved 👍

@s-trinh s-trinh closed this Mar 16, 2026
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 this pull request may close these issues.

2 participants