[compile error] in building calcOpticalFlowFarneback example
Hello !
I encountered the following compile errors when build calcOpticalFlowFarneback example (farneback_optical_flow.cpp).
however I have no idea where's the errors come from. does anyone know why ?
I just guess major errors are "saturate_cast : __forceinline not permitted ~" and "C++ asm syntax ignored ~", and something might not be included in the project.
- with opencv 2.4.8, VS 2012
thanks in advance !
Best Regards, yeonchool
the errors >
d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(54): error C2065: 'uint' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(54): error C2146: syntax error : missing ')' before identifier 'v' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(54): error C2433: 'saturate_cast' : '__forceinline' not permitted on data declarations 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(54): error C2365: 'cv::gpu::device::saturate_cast' : redefinition; previous definition was 'function' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(54): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(55): error C2143: syntax error : missing ';' before '{' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(55): error C2447: '{' : missing function header (old-style formal list?) 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(61): error C2065: 'uint' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(61): error C2146: syntax error : missing ';' before identifier 'res' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(61): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(63): error C2143: syntax error : missing ')' before ':' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(63): error C2290: C++ 'asm' syntax ignored. Use __asm. 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(63): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(64): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(68): error C2065: 'uint' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(68): error C2146: syntax error : missing ';' before identifier 'res' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(68): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(69): error C2143: syntax error : missing ')' before ':' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(69): error C2290: C++ 'asm' syntax ignored. Use __asm. 1>d:#home#project\denseopticalflow\denseopticalflow ...
How did you build this example? Did you build it as a part of OpenCV project or you added
farneback_optical_flow.cpp
to your project? Did you modify this source?opencv2\gpu\device\saturate_cast.hpp
header can be used only in CUDA code that compiles with NVCC, butfarneback_optical_flow.cpp
doesn't include this header.I added and compiled it in my application. what headers should I add to compile it in my project ? or I cannot use the function without NVCC ?