解决QT报错

报错:

/// libGIF,类似的还有libJPEG,libTIFF,libPng
19:29:06: Starting /Users/zzi/Library/Mobile Documents/com~apple~CloudDocs/my/myqt/build-02_MacQT-Desktop_x86_darwin_generic_mach_o_64bit-Debug/02_MacQT.app/Contents/MacOS/02_MacQT ...
dyld: Symbol not found: __cg_DGifCloseFile
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libGIF.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
19:29:06: 程序异常结束。
19:29:06: The process was ended forcefully.
19:29:06: /Users/zzi/Library/Mobile Documents/com~apple~CloudDocs/my/myqt/build-02_MacQT-Desktop_x86_darwin_generic_mach_o_64bit-Debug/02_MacQT.app/Contents/MacOS/02_MacQT crashed.

解决方法:

cd /usr/local/lib
mv libjpeg.dylib libjpeg.dylib.backup
ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib libJPEG.dylib
mv libtiff.dylib libtiff.dylib.backup
ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libTIFF.dylib libTIFF.dylib
mv libpng.dylib libpng.dylib.backup
ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libPng.dylib libPNG.dylib
mv libGIF.dylib libGIF.dylib.backup
ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libGIF.dylib libGIF.dylib

你可能感兴趣的:(解决QT报错)