Я пытаюсь собрать zxing с помощью MinGW, но он не удается с ошибкой 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.
Проблема была из-за порядка ссылок, -liconv
нужно идти после build\libzxing.a
в командной строке, как сказал @Mat.
Других решений пока нет …