Macos 链接/usr/local/lib时,Qt Creator在运行程序时失败
鉴于以下简单项目:Macos 链接/usr/local/lib时,Qt Creator在运行程序时失败,macos,qt,libpng,Macos,Qt,Libpng,鉴于以下简单项目: QT += core QT -= gui TARGET = ConsoleTest08 CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp LIBS += -L/usr/local/lib 使用此简单的main.cpp文件: 从Qt Creator运行时,出现以下错误: dyld: Symbol not found: __cg_png_create_info_struct
QT += core
QT -= gui
TARGET = ConsoleTest08
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L/usr/local/lib
使用此简单的main.cpp文件:
从Qt Creator运行时,出现以下错误:
dyld: Symbol not found: __cg_png_create_info_struct
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib/libPng.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
The program has unexpectedly finished.
从终点站出发,它运行良好
这是我的配置:
- OSX 10.9
- Qt 5.5.1叮当声64 biy
- QtCreator 3.6.0
知道发生了什么吗?我解决了我的问题,在“我的项目运行”部分取消选中“将新的“添加构建库搜索路径到DYLD_库路径”和“DYLD_框架路径”复选框:
我很高兴这解决了你的问题,你知道它做了什么,以及它是如何解决的吗?或者您的问题到底是什么?系统库和自制安装的库之间可能存在一些冲突。
dyld: Symbol not found: __cg_png_create_info_struct
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /usr/local/lib/libPng.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
The program has unexpectedly finished.