手机版
你好,游客 登录 注册
背景:
阅读新闻

OpenCV2.4.2移植到Tiny6410

[日期:2012-11-15] 来源:Linux社区  作者:小安崽崽 [字体:大 中 小]

错误一:

Linking CXX executable ../../bin/opencv_createsamples
../../lib/libopencv_core.so: undefined reference to `clock_gettime'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'
../../lib/libopencv_core.so: undefined reference to `pthread_key_create

解决方法:
修改CMakeCache.txt,CMAKE_EXE_LINKER_FLAGS原来为空,加上-lpthread -lrt,重新编译,错误消除

错误二:
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmalloc'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcpy'
../../lib/libopencv_highgui.so: undefined reference to `TIFFOpen'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFfree'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFwarningHandler'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcmp'
../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemset'
解决方法:修改CMakeCache.txt,WITH_TIFF:BOOL=ON,改成OFF,重新编译,错误消除。

#make install
三、测试

测试程序:
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>


int main(int argc,char **argv)
{
CvCapture* capture = NULL;
IplImage* frame = NULL;

if(!(capture = cvCaptureFromCAM(-1)))
{
fprintf(stderr, "Can not open camera./n");
return -1;
}

cvNamedWindow("video", 1);

while(frame = cvQueryFrame( capture ) )
{
cvShowImage("video", frame);
}

cvDestroyWindow("video");
cvReleaseCapture(&capture);

return 0;
}

编译:
#arm-linux-g++ -o opencv_test opencv_test.cpp -I /usr/local/include -L /usr/local/lib -lopencv_core -lopencv_highgui -lpthread -lrt

单个opencv的make就花了大概1个半小时,终于成功了,但是这只是开始,要想运用opecv+qt+x264+ffmpeg做东西,这还需要更长远的学习啊

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款