0

MinGWを使用してzxingを構築しようとしていますが、エラーで失敗しますundefined reference to libiconv_close

これはビルドの出力です:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build\zxing.exe -Ldl -L/usr/lib -LC:/MinGW/msys/1.0/local/lib -liconv build\magick\src\MagickBitmapSource.o build\magick\src\main.o build\libzxing.a -lMagick++ -lMagickWand -lMagickCore
build\libzxing.a(Decoder.o): In function `add':
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/aztec/decoder/Decoder.cpp:51: undefined reference to `libiconv_open'
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/aztec/decoder/Decoder.cpp:52: undefined reference to `libiconv'
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/aztec/decoder/Decoder.cpp:53: undefined reference to `libiconv_close'
build\libzxing.a(DecodedBitStreamParser.o): In function `ZN5zxing6qrcode22DecodedBitStreamParser6appendERSsPKhjPKc':
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp:70: undefined reference to `libiconv_open'
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp:85: undefined reference to `libiconv'
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp:87: undefined reference to `libiconv_close'
C:\Workspace\BarCodes\zxing-2.1\cpp/build/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp:92: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
scons: *** [build\zxing.exe] Error 1
scons: building terminated because of errors.
4

1 に答える 1

0

@Matが言ったように、問題はリンクの順序が原因で、コマンドラインで追跡-liconvする必要がありました。build\libzxing.a

于 2012-11-15T13:44:36.267 に答える