That mixup was because i also tried checking with gcc 9 as i had issues compiling with gcc 11.
Below is my makefile, using gcc 11.
`CC=g+±11
NVCC=nvcc
OPENCV_CFLAGS=$(shell pkg-config --cflags opencv4)
OPENCV_LIBS=$(shell pkg-config --libs opencv4)
CUDA runtime library and C++ standard
LIBS=-lcudart $(OPENCV_LIBS)
CXXFLAGS=-std=c++17
NVCCFLAGS=-ccbin $(CC) $(OPENCV_CFLAGS) -Xcompiler “$(CXXFLAGS)”
LDFLAGS=$(LIBS)
TARGET=app
SRC = imageprocessing.cu
$(TARGET):
$(NVCC) $(SRC) -o $(TARGET) $(NVCCFLAGS) $(LDFLAGS)
clean:
rm -f $(TARGET)
`
headers used in my .cu file:
#include <opencv2/opencv.hpp> #include <opencv2/core/cuda.hpp> #include <iostream>
output when i run make:
`nvcc imageprocessing.cu -o app -ccbin g+±11 -I/usr/local/include/opencv4 -Xcompiler “-std=c++17” -lcudart -L/usr/local/lib -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core
/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function “cv::detail::PlaneWarper::buildMaps” is only partially overridden in class “cv::detail::AffineWarper”
/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function “cv::detail::PlaneWarper::warp” is only partially overridden in class “cv::detail::AffineWarper”
/usr/local/include/opencv4/opencv2/stitching/detail/matchers.hpp(182): warning #611-D: overloaded virtual function “cv::detail::FeaturesMatcher::match” is only partially overridden in class “cv::detail::BestOf2NearestMatcher”
/usr/local/include/opencv4/opencv2/stitching/detail/matchers.hpp(236): warning #611-D: overloaded virtual function “cv::detail::FeaturesMatcher::match” is only partially overridden in class “cv::detail::AffineBestOf2NearestMatcher”
/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(100): warning #611-D: overloaded virtual function “cv::detail::Blender::prepare” is only partially overridden in class “cv::detail::FeatherBlender”
/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(127): warning #611-D: overloaded virtual function “cv::detail::Blender::prepare” is only partially overridden in class “cv::detail::MultiBandBlender”
/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function “cv::detail::PlaneWarper::buildMaps” is only partially overridden in class “cv::detail::AffineWarper”
/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function “cv::detail::PlaneWarper::warp” is only partially overridden in class “cv::detail::AffineWarper”
/usr/local/include/opencv4/opencv2/stitching/detail/matchers.hpp(182): warning #611-D: overloaded virtual function “cv::detail::FeaturesMatcher::match” is only partially overridden in class “cv::detail::BestOf2NearestMatcher”
/usr/local/include/opencv4/opencv2/stitching/detail/matchers.hpp(236): warning #611-D: overloaded virtual function “cv::detail::FeaturesMatcher::match” is only partially overridden in class “cv::detail::AffineBestOf2NearestMatcher”
/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(100): warning #611-D: overloaded virtual function “cv::detail::Blender::prepare” is only partially overridden in class “cv::detail::FeatherBlender”
/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(127): warning #611-D: overloaded virtual function “cv::detail::Blender::prepare” is only partially overridden in class “cv::detail::MultiBandBlender”
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
make: *** [makefile:24: app] Error 1`