您尚未登录。

楼主 #1 2018-06-30 19:47:41

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

关于编译连接出现undefined reference to `xxx' 到底是没找到xxx涵数,还是找不到库呢,像这种问题如何解决?

arm-linux-g++ -lts -Wl,-O1 -Wl,-rpath,/usr/local/qt/lib -o demo_qzxing CameraImageWrapper.o qzxing.o imagehandler.o ResultPointCallback.o ResultPoint.o Result.o ReaderException.o Reader.o NotFoundException.o MultiFormatReader.o LuminanceSource.o FormatException.o Exception.o DecodeHints.o BinaryBitmap.o Binarizer.o BarcodeFormat.o AztecReader.o AztecDetectorResult.o StringUtils.o Str.o PerspectiveTransform.o IllegalArgumentException.o HybridBinarizer.o GridSampler.o GreyscaleRotatedLuminanceSource.o GreyscaleLuminanceSource.o GlobalHistogramBinarizer.o EdgeDetector.o DetectorResult.o DecoderResult.o Counted.o CharacterSetECI.o BitSource.o BitMatrix.o BitArray.o Array.o WhiteRectangleDetector.o MonochromeRectangleDetector.o ReedSolomonException.o ReedSolomonDecoder.o GenericGFPoly.o GenericGF.o DataMatrixReader.o UPCEReader.o UPCEANReader.o UPCAReader.o OneDResultPoint.o OneDReader.o MultiFormatUPCEANReader.o MultiFormatOneDReader.o ITFReader.o EAN13Reader.o EAN8Reader.o Code128Reader.o Code39Reader.o QRCodeReader.o QREdgeDetector.o MultipleBarcodeReader.o GenericMultipleBarcodeReader.o ByQuadrantReader.o QRCodeMultiReader.o MultiFinderPatternFinder.o MultiDetector.o AztecDecoder.o AztecDetector.o DataMatrixVersion.o DataMatrixDecoder.o DataMatrixBitMatrixParser.o DataMatrixDataBlock.o DataMatrixDecodedBitStreamParser.o DataMatrixCornerPoint.o DataMatrixDetector.o DataMatrixDetectorException.o DataMatrixMonochromeRectangleDetector.o QRBitMatrixParser.o QRDataBlock.o QRDataMask.o QRDecodedBitStreamParser.o QRDecoder.o QRMode.o QRAlignmentPattern.o QRAlignmentPatternFinder.o QRDetector.o QRFinderPattern.o QRFinderPatternFinder.o QRFinderPatternInfo.o QRVersion.o QRFormatInformation.o QRErrorCorrectionLevel.o main.o mainwindow.o moc_imagehandler.o moc_qzxing.o moc_mainwindow.o    -L/usr/local/tslib/lib -L/usr/local/qt/lib -lQtDeclarative -L/usr/local/qt/lib -L/usr/local/tslib/lib -lQtScript -lQtSql -lQtGui -lQtNetwork -lQtCore -lpthread
AztecDecoder.o: In function `(anonymous namespace)::add(std::string&, unsigned char)':
AztecDecoder.cpp:(.text+0x38): undefined reference to `libiconv_open'
AztecDecoder.cpp:(.text+0x54): undefined reference to `libiconv'
AztecDecoder.cpp:(.text+0x5c): undefined reference to `libiconv_close'
QRDecodedBitStreamParser.o: In function `zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned int, char const*)':
QRDecodedBitStreamParser.cpp:(.text+0x54): undefined reference to `libiconv_open'
QRDecodedBitStreamParser.cpp:(.text+0xc0): undefined reference to `libiconv'
QRDecodedBitStreamParser.cpp:(.text+0xd0): undefined reference to `libiconv_close'
QRDecodedBitStreamParser.cpp:(.text+0x10c): undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
make: *** [demo_qzxing] Error 1

离线

#2 2018-06-30 20:09:39

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于编译连接出现undefined reference to `xxx' 到底是没找到xxx涵数,还是找不到库呢,像这种问题如何解决?

缺libiconv字符转码库。





离线

楼主 #3 2018-06-30 20:40:50

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 关于编译连接出现undefined reference to `xxx' 到底是没找到xxx涵数,还是找不到库呢,像这种问题如何解决?

晕哥 说:

缺libiconv字符转码库。

晕哥,你是怎么断判缺少库的

离线

#4 2018-06-30 21:29:09

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于编译连接出现undefined reference to `xxx' 到底是没找到xxx涵数,还是找不到库呢,像这种问题如何解决?

根据经验,QRDecodedBitStreamParser.cpp:(.text+0x10c): undefined reference to `libiconv_close'

这种链接错误一看就是找不到链接对象。





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn