[compile error] in building calcOpticalFlowFarneback example

asked 2014-02-10 04:35:05 -0600

parkpd gravatar image

updated 2014-02-10 04:37:19 -0600

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 ... (more)

edit retag flag offensive close merge delete

Comments

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, but farneback_optical_flow.cpp doesn't include this header.

Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2014-02-10 05:57:09 -0600 )edit

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 ?

  • thanks in advance !
parkpd gravatar imageparkpd ( 2014-02-10 23:09:28 -0600 )edit