Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ARM cross compilation error with Opencv

Hi guys, I have a nightmare with the cross-compilation of Opencv for ARM.

I am making an c++ application in Linux wich use Opencv Libraries. I followed this tutorial for get the opencv source:

http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html

I have already other tools-chain which I get from the supplier. When I finish the opencv install I have the opnecv folder with everything.

So I tried to compile my file like always:

 arm-linux-g++ -o camera Ipcamera.cpp

But I get this error:

IPCamera.cpp:12:30: error: opencv2/opencv.hpp: No such file or directory
IPCamera.cpp:13:29: error: opencv2/highgui.h: No such file or directory
IPCamera.cpp:14:39: error: opencv2/imgproc/imgproc.hpp: No such file or directory
IPCamera.cpp:18:22: error: X11/Xlib.h: No such file or directory
IPCamera.cpp:23: error: 'cv' is not a namespace-name
IPCamera.cpp:23: error: expected namespace-name before ';' token
IPCamera.cpp: In function 'int main(int, char**)':
IPCamera.cpp:53: error: 'cv' has not been declared
IPCamera.cpp:53: error: expected ';' before 'cap'
IPCamera.cpp:59: error: 'Display' was not declared in this scope
IPCamera.cpp:59: error: 'disp' was not declared in this scope
IPCamera.cpp:59: error: 'XOpenDisplay' was not declared in this scope
IPCamera.cpp:60: error: 'Screen' was not declared in this scope
IPCamera.cpp:60: error: 'scrn' was not declared in this scope
IPCamera.cpp:60: error: 'DefaultScreenOfDisplay' was not declared in this scope
IPCamera.cpp:70: error: 'cv' has not been declared
IPCamera.cpp:70: error: expected ';' before 'frame'
IPCamera.cpp:73: error: 'cv' has not been declared
IPCamera.cpp:73: error: 'CV_WINDOW_NORMAL' was not declared in this scope
IPCamera.cpp:75: error: 'cvMoveWindow' was not declared in this scope
IPCamera.cpp:80: error: 'CV_WND_PROP_FULLSCREEN' was not declared in this scope
IPCamera.cpp:80: error: 'CV_WINDOW_FULLSCREEN' was not declared in this scope
IPCamera.cpp:80: error: 'cvSetWindowProperty' was not declared in this scope
IPCamera.cpp:96: error: 'cap' was not declared in this scope
IPCamera.cpp:99: error: 'frame' was not declared in this scope
IPCamera.cpp:106: error: 'cv' has not been declared
IPCamera.cpp:109: error: 'cv' has not been declared

I have this includes in my .cpp file:

 #include <opencv2/opencv.hpp>     
 #include <opencv2/highgui.h>      
 #include <opencv2/imgproc/imgproc.hpp>

I was reading and the people says that I had to add the headers libraries path:

 arm-linux-g++ -o camera Ipcamera.cpp -I/home/jesus/opencv_build/build/opencv/include

this is the Path in which I have the opencv and opencv2 folders, but again I get other error:

    from IPCamera.cpp:12:
/home/jesus/opencv_build/build/opencv/include/opencv2/core/core.hpp:48:33: error: #include nested too deeply
In file included from IPCamera.cpp:12:
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:47:31: error: opencv2/imgproc.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:48:29: error: opencv2/photo.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:49:29: error: opencv2/video.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:50:34: error: opencv2/features2d.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:51:33: error: opencv2/objdetect.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:52:31: error: opencv2/calib3d.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:53:31: error: opencv2/highgui.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:54:31: error: opencv2/contrib.hpp: No such file or directory
/home/jesus/opencv_build/build/opencv/include/opencv2/opencv.hpp:55:26: error: opencv2/ml.hpp: No such file or directory
IPCamera.cpp:13:29: error: opencv2/highgui.h: No such file or directory
IPCamera.cpp:18:22: error: X11/Xlib.h: No such file or directory
IPCamera.cpp:23: error: 'cv' is not a namespace-name
IPCamera.cpp:23: error: expected namespace-name before ';' token
IPCamera.cpp: In function 'int main(int, char**)':
IPCamera.cpp:53: error: 'cv' has not been declared
IPCamera.cpp:53: error: expected ';' before 'cap'
IPCamera.cpp:59: error: 'Display' was not declared in this scope
IPCamera.cpp:59: error: 'disp' was not declared in this scope
IPCamera.cpp:59: error: 'XOpenDisplay' was not declared in this scope
IPCamera.cpp:60: error: 'Screen' was not declared in this scope
IPCamera.cpp:60: error: 'scrn' was not declared in this scope
IPCamera.cpp:60: error: 'DefaultScreenOfDisplay' was not declared in this scope
IPCamera.cpp:70: error: 'cv' has not been declared
IPCamera.cpp:70: error: expected ';' before 'frame'
IPCamera.cpp:73: error: 'cv' has not been declared
IPCamera.cpp:73: error: 'CV_WINDOW_NORMAL' was not declared in this scope
IPCamera.cpp:75: error: 'cvMoveWindow' was not declared in this scope
IPCamera.cpp:80: error: 'CV_WND_PROP_FULLSCREEN' was not declared in this scope
IPCamera.cpp:80: error: 'CV_WINDOW_FULLSCREEN' was not declared in this scope
IPCamera.cpp:80: error: 'cvSetWindowProperty' was not declared in this scope
IPCamera.cpp:96: error: 'cap' was not declared in this scope
IPCamera.cpp:99: error: 'frame' was not declared in this scope
IPCamera.cpp:106: error: 'cv' has not been declared
IPCamera.cpp:109: error: 'cv' has not been declared

I have been reading and asking for everywhere but I did not get nothing, and I do not what can I do.

I hope my explanation is clear, sorry if it is not

Thanks