Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

[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 ! - 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\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(69): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(70): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2065: 'uint' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2146: syntax error : missing ';' before identifier 'res' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2143: syntax error : missing ')' before ':' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2290: C++ 'asm' syntax ignored. Use __asm. 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(76): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(83): error C2912: explicit specialization; 'uchar cv::gpu::device::saturate_cast<uchar>(int)' is not a specialization of a function template 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(83): fatal error C1903: unable to recover from previous error(s); stopping compilation

[compile error] in building calcOpticalFlowFarneback example

Hello !

I encountered the following compile errors when build calcOpticalFlowFarneback example (farneback_optical_flow.cpp). (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\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(69): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(70): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2065: 'uint' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2146: syntax error : missing ';' before identifier 'res' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(74): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2143: syntax error : missing ')' before ':' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2290: C++ 'asm' syntax ignored. Use __asm. 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(75): error C2059: syntax error : ')' 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(76): error C2065: 'res' : undeclared identifier 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(83): error C2912: explicit specialization; 'uchar cv::gpu::device::saturate_cast<uchar>(int)' is not a specialization of a function template 1>d:#home#project\denseopticalflow\denseopticalflow\opencv2.4.8\include\opencv2\gpu\device\saturate_cast.hpp(83): fatal error C1903: unable to recover from previous error(s); stopping compilation