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

compile failure due to <Type> syntax #3580

Closed
devinsodhi opened this issue Oct 20, 2023 · 2 comments · Fixed by #3584
Closed

compile failure due to <Type> syntax #3580

devinsodhi opened this issue Oct 20, 2023 · 2 comments · Fixed by #3584

Comments

@devinsodhi
Copy link

devinsodhi commented Oct 20, 2023

System information (version)
  • OpenCV => 4.x
  • Operating System / Platform => ubuntu 22.04
  • Compiler => gcc 11.4
Detailed description

On trying to compile 4.x with CUDA, this issue comes up:
opencv_contrib/modules/xphoto/src/oilpainting.cpp:61:34: error: expected ‘)’ before ‘&’ token
61 | ParallelOilPainting(Mat& img, Mat &d, Mat &iLuminance, int r,int k) :

Steps to reproduce

My CMAKE flags were:
-D CUDNN_LIBRARY=usr/lib/x86_64-linux-gnu/libcudnn.so
-D CUDNN_INCLUDE_DIR=/usr/include
-D CMAKE_CXX_STANDARD=17
-D OPENCV_GENERATE_PKGCONFIG=YES
-D CMAKE_CXX_STANDARD_REQUIRED=ON
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX="$install_path"
-D OPENCV_EXTRA_MODULES_PATH="$contrib_path/modules"
-D WITH_CUDA=ON
-D WITH_CUDNN=ON
-D WITH_GTK=ON
-D WITH_VTK=OFF
-D OPENCV_DNN_CUDA=ON
-D ENABLE_FAST_MATH=1
-D CUDA_FAST_MATH=1
-D CUDA_ARCH_BIN="$cuda_arch_bin"
-D WITH_CUBLAS=1
-D WITH_LIBV4L=ON
-D WITH_OPENGL=ON
-D WITH_TBB=ON
-D WITH_QT=ON
-D OPENCV_ENABLE_NONFREE=ON
-D INSTALL_PYTHON_EXAMPLES=OFF
-D BUILD_opencv_java=OFF
-D BUILD_opencv_python=OFF
-D INSTALL_C_EXAMPLES=OFF
-D INSTALL_PYTHON_EXAMPLES=OFF
-D BUILD_EXAMPLES=OFF
-D CMAKE_CXX_FLAGS=${SIMD_FLAG}

The seems to break cpp compiles for C++ 17, and 23. Removing "Type " addresses the issue.

Issue submission checklist
  • [ X] I report the issue, it's not a question
  • [X ] I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found any solution
  • [ X] I updated to the latest OpenCV version and the issue is still there
  • [ X] There is reproducer code and related data files: videos, images, onnx, etc

The same issue is true for opencv_contrib/modules/datasets/src/tinyxml2/tinyxml2.h: At global scope:
opencv_contrib/modules/datasets/src/tinyxml2/tinyxml2.h:215:25: error: expected unqualified-id before ‘)’ token
215 | DynArray< T, INIT >() {

@asmorkalov
Copy link
Contributor

@devinsodhi
Copy link
Author

thanks! would my proposed issue be ok as a patch or do we want to wait on the standard fix to gcc?

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

Successfully merging a pull request may close this issue.

2 participants