您的位置:首页 > 其它

libdecodeqr-0.9.3在ubuntu上移植记录

2014-12-24 14:49 1116 查看
依赖

opencv-2.0.0

解压

#tar -xjvf libdecodeqr-0.9.3.tar.bz2

出现 doc img src 三个目录

#cd src
#./configure
#make



错误解决

./configure 然后出现checking for cvCreateImage in -lcv... no 之后配置失败

#cd src
#vi configure
//char cvCreateImage ();
int
main ()
{
//return cvCreateImage ();
;
return 0;
}

./configure 然后出现If your system already has OpenCV, append place of the cv.h 之后配置失败

如果你的头文件在 /usr/local/include/opencv/目录下

#cp /usr/local/include/opencv/* /usr/local/include/



错误libdecodeqr.a(imagereader.o): undefined reference to symbol 'cvApproxPoly'

g++ -Wl,-Bsymbolic-functions -L../../libdecodeqr -o libdecodeqr-simpletest simpletest.o -lcv -lhighgui -lcxcore -ldecodeqr

/usr/bin/ld: ../../libdecodeqr/libdecodeqr.a(imagereader.o): undefined reference to symbol 'cvApproxPoly'

/usr/bin/ld: note: 'cvApproxPoly' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libcv.so so try adding it to the linker command line

/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libcv.so: could not read symbols: Invalid operation

collect2: ld returned 1 exit status

make[4]: *** [libdecodeqr-simpletest] Error 1

#cd src/sample/simple
#vi Makefle
CXX=g++
CPPFLAGS=-I/usr/local/include/+set -I/usr/local/include/opencv -g -O2 -c -I$(LI$

LIBCV=-lcv
LIBHIGHGUI=-lhighgui
LIBCXCORE=-lcxcore
LIBCVAUX=-lcvaux
LIBS=-ldecodeqr $(LIBCXCORE) $(LIBCV) $(LIBHIGHGUI)

LDFLAGS= -L$(LIBDECODEQR_DIR) -L/usr/local/lib

Reorder library linking so that -lcv comes after -ldecodeqr which references it.

__CV_BEGIN__ __CV_EXIT__没有定义

如果装的是opencv-2.1.0将会出现类似的错误。

make[1]: Entering directory `/home/pjq/libdecodeqr-0.9.3-5ubuntu1/src/libdecodeqr'

g++ -g -O2 -fPIC -c imagereader.cpp

In file included from /usr/local/include/ml.h:115:0,

from imagereader.h:22,

from imagereader.cpp:14:

imagereader.cpp: In function ‘void Qr::apaptive_white_leveling(const CvArr*, CvArr*, double, int, int, int, double)’:

imagereader.cpp:1056:13: error: ‘__CV_EXIT__’ was not declared in this scope

CV_ERROR( CV_StsBadArg,

^

imagereader.cpp:1062:13: error: ‘__CV_EXIT__’ was not declared in this scope

CV_ERROR( CV_StsBadArg, "Only CV_TRESH_BINARY and CV_THRESH_BINARY_INV "

^

imagereader.cpp:1069:13: error: ‘__CV_EXIT__’ was not declared in this scope

CV_ERROR( CV_StsUnmatchedFormats, "" );

^

imagereader.cpp:1072:13: error: ‘__CV_EXIT__’ was not declared in this scope

CV_ERROR( CV_StsUnsupportedFormat, "" );

^

imagereader.cpp:1075:13: error: ‘__CV_EXIT__’ was not declared in this scope

CV_ERROR( CV_StsUnmatchedSizes, "" );

^

make[1]: *** [imagereader.o] Error 1

make[1]: Leaving directory `/home/pjq/libdecodeqr-0.9.3-5ubuntu1/src/libdecodeqr'

make: *** [libdecodeqr] Error 2

#vi /usr/local/include/cxerror.h
#endif /* _CXCORE_ERROR_H_ */

#define __BEGIN__ {
#define __END__ goto exit; exit: ; }
#define __CLEANUP__
#define EXIT goto exit

#define __CV_BEGIN__ {
#define __CV_END__ goto exit; exit: ; }
#define __CV_EXIT__ goto exit

/* End of file. */
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: