Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 链接/usr/local/lib时,Qt Creator在运行程序时失败_Macos_Qt_Libpng - Fatal编程技术网

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
我最近更新到Qt Creator 3.6.0,因此怀疑有bug

我通过brew安装了libpng 1.6.21,这可能与ImageIO框架冲突,但我没有明确链接它们


知道发生了什么吗?

我解决了我的问题,在“我的项目运行”部分取消选中“将新的“添加构建库搜索路径到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.