Turn http://blog.163.com/yankang0612@126/blog/static/16418746420114190365981? Latestblog
The platform is the tq2440 Development Board and the compiler version is 4.3.3. First download the opencv2.2.0 source code and the cmake-GUI tool, decompress it to the/usr/local directory, and create the opencv-arm folder under the/usr/local directory, at the same time, create a directory named arm to place the final generated files,
Run cmake-Gui on the terminal to select the source code directory:/usr/local/OpenCV-2.2.0
Select the build Directory:/usr/local/opencv-arm/
Click Configure, keep generator as UNIX makefiles, select specify options for cross-compiling, and click Next
Set Operating System to arm-inux.
C compilers fill in/opt/embedsky/4.3.3/bin/ARM-Linux-gcc
C ++ compilers fill in/opt/embedsky/4.3.3/bin/ARM-Linux-G ++
Enter/opt/embedsky/4.3.3/as the target root of the library, and click Finish.
Modify the default configuration. The default installation directory is/usr/local. To facilitate searching for the generated library files, change the cmake_install_prefix variable to/usr/local/arm. Click Generate to generate the makefile and then make,
Error at 59%,/usr/local/OpenCV-2.2.0/modules/highgui/src/grfmt_png.cpp: 55: 24: Error: LibPNG/PNG. h: no such file or directory
Results PNG. h was found under OpenCV-2.2.0/3 rdparty/libpng/, and the path was completed under PNG. cpp. The error disappears. Continue make.
Error at 79%, OpenCV-2.2.0/modules/ml/src/Gbt. CPP: 474: Error: 'expl' was not declared in this scope; Modify GDB. CPP, comment out # If Android and # endlf, and continue.
Error at 81%, http://www.cnblogs.com/lib/libopencv_haartraining_engine.a (cvhaartraining. OBJ): In function 'cvcreatetestsamples (char const *, char const *, Int, Int, char const *, Int, Double, double, Int, INT )':
Cvhaartraining. cpp :(. Text. _ z19cvcreatetestsamplespkcs0_iis0_iiidddiii + 0x454): Undefined reference to 'cvshowimag'
Cvhaartraining. cpp :(. Text. _ z19cvcreatetestsamplespkcs0_iis0_iiidddiii + 0x45c): Undefined reference to 'cvwaitkey'
Cvhaartraining. cpp :(. Text. _ z19cvcreatetestsamplespkcs0_iis0_iiidddiii + 0x534): Undefined reference to 'cvnamedwindow'
Http://www.cnblogs.com/lib/libopencv_haartraining_engine.a (cvhaartraining. OBJ): In function 'cvcreatetrainingsamples (char const *, char const *, Int, Int, char const *, Int, Double, double, double, Int, INT )':
After a long time, I still have no answer. I hope the person who knows how to change the answer will tell me,
I decompress the package in the/OPT directory again according to the above steps. After make, the package reaches 79%. After the change, http://www.cnblogs.com/lib/libcxcore.so: undefined reference to 'clock _ gettime' appears at 81%'
Solution: Modify cmakecache.txt, cmake_exe_linker_flags, and add-lpthread-LRT to re-compile and eliminate errors. Then, at 96% o'clock.
Error: http://www.cnblogs.com/lib/libopencv_features2d.so: undefined reference to 'cv: sift (double, bool, bool, Int, INT )'
Solution: Under/opt/opencv2.2.0/modules/features2d/src/sift. cpp # ifdef _ arm __
# Define arm_no_sift
# Endif comment out # define arm_no_sift. error elimination,
Okay, it's safe to reach 100%.
Therefore, we recommend that you put the opencv-arm to be created and the arm directory and cross compiler to the same directory. I cannot understand why.
Then make install
Copy the generated opencv header file and library file to the Cross-compiler. First, copy the/opt/ARM/include/opencv/opencv2 directory and the files under opencv. to the/opt/embedsky/4.3.3/ARM-None-Linux-gnueabi/include directory. Copy the library files under/opt/ARM/lib to/embedsky/4.3.3/ARM-None-Linux-gnueabi/libc/lib.
Test the arm-Linux-G ++-LCV-lcxcore-lhighgui-lpthread-LRT-O test. c
Generate a binary file.
Finally, copy the library files under/opt/ARM/lib to the/lib/directory of the Development Board. Copy the test execution file. If it runs normally, it indicates that the migration is successful.