libdecodeqr-0.9.3在ubuntu上移植记录

本文详细介绍了如何解决在使用OpenCV版本2.0.0与libdecodeqr库集成时遇到的错误,包括配置问题和库引用问题,并提供了相应的解决方案,帮助开发者顺利实现二维码解码功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

依赖

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. */

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值