使用OpenCV3.4.5的Qt5中与Cuda相关的编译错误
我构建OpenCV3.4.5时启用了Cuda支持,支持VS2015和Cuda8.0(请参阅本文)。整个生成过程继续进行,没有错误,生成:605成功,1失败,0最新,0跳过。以下给出了OpenCV3.4.5的建筑配置,供您参考:使用OpenCV3.4.5的Qt5中与Cuda相关的编译错误,qt,opencv,Qt,Opencv,我构建OpenCV3.4.5时启用了Cuda支持,支持VS2015和Cuda8.0(请参阅本文)。整个生成过程继续进行,没有错误,生成:605成功,1失败,0最新,0跳过。以下给出了OpenCV3.4.5的建筑配置,供您参考: -- General configuration for OpenCV 3.4.5 ===================================== -- Version control: unknown -- --
-- General configuration for OpenCV 3.4.5 =====================================
-- Version control: unknown
--
-- Platform:
-- Timestamp: 2019-01-09T23:07:28Z
-- Host: Windows 10.0.17134 AMD64
-- CMake: 3.9.1
-- CMake generator: Visual Studio 14 2015 Win64
-- CMake build tool: C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
-- MSVC: 1900
--
-- CPU/HW features:
-- Baseline: SSE SSE2 SSE3
-- requested: SSE3
-- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2
-- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
-- SSE4_1 (6 files): + SSSE3 SSE4_1
-- SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
-- FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
-- AVX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
-- AVX2 (12 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++11: YES
-- C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24215.1)
-- C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP4 /MD /O2 /Ob2 /DNDEBUG
-- C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP4 /MDd /Zi /Ob0 /Od /RTC1
-- C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP4 /MD /O2 /Ob2 /DNDEBUG
-- C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP4 /MDd /Zi /Ob0 /Od /RTC1
-- Linker flags (Release): /machine:x64 /INCREMENTAL:NO
-- Linker flags (Debug): /machine:x64 /debug /INCREMENTAL
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: cudart.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: calib3d core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo python3 python_bindings_generator shape stitching superres ts video videoio videostab world
-- Disabled: -
-- Disabled by dependency: -
-- Unavailable: java js python2 python2 viz
-- Applications: tests perf_tests examples apps
-- Documentation: NO
-- Non-free algorithms: NO
--
-- Windows RT support: NO
--
-- GUI:
-- QT: YES (ver 5.7.0)
-- QT OpenGL support: NO
-- Win32 UI: YES
-- VTK support: NO
--
-- Media I/O:
-- ZLib: build (ver 1.2.11)
-- JPEG: build-libjpeg-turbo (ver 1.5.3-62)
-- WEBP: build (ver encoder: 0x020e)
-- PNG: build (ver 1.6.35)
-- TIFF: build (ver 42 - 4.0.9)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
--
-- Video I/O:
-- DC1394: NO
-- FFMPEG: YES (prebuilt binaries)
-- avcodec: YES (ver 57.107.100)
-- avformat: YES (ver 57.83.100)
-- avutil: YES (ver 55.78.100)
-- swscale: YES (ver 4.8.100)
-- avresample: YES (ver 3.7.0)
-- GStreamer: NO
-- DirectShow: YES
-- Media Foundation: YES
-- DXVA: YES
--
-- Parallel framework: Concurrency
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Intel IPP: 2019.0.0 Gold [2019.0.0]
-- at: E:/In-Field-Sorting-Pro/OpenCV/opencv-3.4.5/cmake-build/3rdparty/ippicv/ippicv_win/icv
-- Intel IPP IW: sources (2019.0.0)
-- at: E:/In-Field-Sorting-Pro/OpenCV/opencv-3.4.5/cmake-build/3rdparty/ippicv/ippicv_win/iw
-- Lapack: NO
-- Eigen: NO
-- Custom HAL: NO
-- Protobuf: build (3.5.1)
--
-- NVIDIA CUDA: YES (ver 8.0, CUFFT CUBLAS NVCUVID FAST_MATH)
-- NVIDIA GPU arch: 20 30 35 37 50 52 60 61
-- NVIDIA PTX archs:
--
-- OpenCL: YES (no extra features)
-- Include path: E:/In-Field-Sorting-Pro/OpenCV/opencv-3.4.5/sources/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 3:
-- Interpreter: C:/Python35/python3.exe (ver 3.5.4)
-- Libraries: C:/Python35/libs/python35.lib (ver 3.5.4)
-- numpy: C:/Python35/lib/site-packages/numpy/core/include (ver 1.13.1)
-- install path: C:/Python35/Lib/site-packages/cv2/python-3.5
--
-- Python (for build): C:/Python35/python3.exe
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
-- Install to: C:/opencv-3.4.5/mybuild
使用Qt5.7和自建OpenCV3.4.5,编译我的Qt项目会导致数百个与cuda相关的错误,其中一部分错误(例如,`C2061:syntax error:identifier)如下所示:
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): warning C4002: too many actual parameters for macro 'min'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2182: 'InputArray': illegal use of type 'void'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2146: syntax error: missing ';' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2059: syntax error: ')'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2143: syntax error: missing ';' before '<'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2146: syntax error: missing ')' before identifier 'src2'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2086: 'int cv::cuda::InputArray': redefinition
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): note: see declaration of 'cv::cuda::InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): error C2146: syntax error: missing ';' before identifier 'src2'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): warning C4002: too many actual parameters for macro 'max'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2182: 'InputArray': illegal use of type 'void'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2086: 'int cv::cuda::InputArray': redefinition
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): note: see declaration of 'cv::cuda::InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2146: syntax error: missing ';' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2059: syntax error: ')'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2086: 'int cv::cuda::src1': redefinition
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296): note: see declaration of 'cv::cuda::src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2059: syntax error: '>'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2146: syntax error: missing ')' before identifier 'src2'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307): error C2146: syntax error: missing ';' before identifier 'src2'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(330): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(334): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(335): error C2143: syntax error: missing ';' before '{'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(335): error C2447: '{': missing function header (old-style formal list?)
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(351): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(361): error C2146: syntax error: missing ')' before identifier 'xy'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(369): error C2146: syntax error: missing ')' before identifier 'xy'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(379): error C2146: syntax error: missing ')' before identifier 'x'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(389): error C2146: syntax error: missing ')' before identifier 'x'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(401): error C2146: syntax error: missing ')' before identifier 'x'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(414): error C2146: syntax error: missing ')' before identifier 'x'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(425): error C2146: syntax error: missing ')' before identifier 'magnitude'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(453): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(455): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(465): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(480): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(494): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(501): error C2146: syntax error: missing ')' before identifier 'lut'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(518): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(534): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(536): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(546): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(548): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(557): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(559): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(566): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(568): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(575): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(577): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(590): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(592): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(607): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(610): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(621): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(623): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(651): error C2146: syntax error: missing ')' before identifier 'mtx'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(661): error C2146: syntax error: missing ')' before identifier 'mtx'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(663): error C2146: syntax error: missing ')' before identifier 'mtx'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(673): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(691): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(703): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(712): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(744): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(761): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(778): error C2146: syntax error: missing ')' before identifier 'src1'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(815): error C2146: syntax error: missing ')' before identifier 'src'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(828): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(861): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudabgsegm.hpp(85): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudabgsegm.hpp(132): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafilters.hpp(84): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafilters.hpp(120): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafilters.hpp(159): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafilters.hpp(261): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafeatures2d.hpp(154): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudafeatures2d.hpp(160): error C2061: syntax error: identifier 'InputArray'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):警告C4002:宏“min”的实际参数太多
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):错误C2182:“InputArray”:非法使用类型“void”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):错误C2146:语法错误:缺少“;”在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):错误C2059:语法错误:')'
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(296):错误C2143:语法错误:缺少“;”在“”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307):错误C2146:语法错误:缺少“'),在标识符“src2”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(307):错误C2146:语法错误:缺少“;”在标识符“src2”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(330):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(334):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(335):错误C2143:语法错误:缺少“;”在“{”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(335):错误C2447:“{”:缺少函数头(旧式正式列表?)
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(351):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(361):错误C2146:语法错误:标识符“xy”之前缺少“')”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(369):错误C2146:语法错误:缺少“'),在标识符“xy”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(379):错误C2146:语法错误:标识符“x”之前缺少“')”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(389):错误C2146:语法错误:标识符“x”之前缺少“')”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(401):错误C2146:语法错误:缺少“'),在标识符“x”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(414):错误C2146:语法错误:标识符“x”之前缺少“')”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(425):错误C2146:语法错误:缺少“'),在标识符“幅值”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(453):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(455):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(465):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(480):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(494):错误C2061:语法错误:标识符“InputArray”
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(501):错误C2146:语法错误:缺少“'),在标识符“lut”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(518):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(534):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(536):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(546):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(548):错误C2146:语法错误:缺少“'),在标识符“src1”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(557):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(559):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(566):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(568):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(575):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(577):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(590):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(592):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(607):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(610):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(621):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(623):错误C2146:语法错误:缺少“'),在标识符“src”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(651):错误C2146:语法错误:缺少“'),在标识符“mtx”之前
c:\opencv-3.4.5\mybuild\include\opencv2/cudaarithm.hpp(661):e
too many actual parameters for macro 'max'
//define it when you build as DLL
// undefine it when you build as an exe and undo the steps above in the Project Properties
#define DLL
#ifdef DLL
#define DLL_EXPORT __declspec(dllexport) //shortens __declspec(dllexport) to DLL_EXPORT
#else
#define DLL_EXPORT
#endif
#ifdef __cplusplus //if C++ is used convert it to C to prevent C++'s name mangling of method names
extern "C"
{
#endif
class DLL_EXPORT MaGamesClass
{
public:
/* your class, as usual */
MaGamesClass();
~MaGamesClass();
float _soon = 2019;
};
#ifdef __cplusplus
}
#endif
public :
MaGamesClass();
//Because parameters cannot be set to constructor in DLL (->build error)
static MaGamesClass MaGamesClass_instantiate(std::string where);
static MaGamesClass* MaGamesClass_new(std::string where);
/*
Return this
*/
MaGamesClass* init(std::string where);
~MaGamesClass();
/*
Some guys prefer initialisation of members in the constructor (MaGamesClass MaGamesClass(): _soon(2019){ ... }
I prefered here to avoid as much as possible constructor's build errors
And i find it's more readable anyway :p
*/
float _soon = 2019; //
std::string _where;
using namespace std;
MaGames MaGames::MaGames_instantiate(string where)
{
MaGames vrSport= MaGames();
return *vrSport.init(where);
}
MaGames MaGames::MaGames_new(string where){
MaGames* vrSport= new MaGames();
return vrSport->init(where);
}
MaGames * MaGames ::init(string where)
{
_where = where;
return this;
}
MaGames myCenter = MaGamesClass::MaGamesClass_instantiate("France");
MaGames* myCenter = MaGamesClass::MaGamesClass_new("Closer?");
#include <opencv2/cudaarithm.hpp>
//or
#include <opencv2/opencv.hpp>