Qt Creator failed on running program when linking /usr/local/lib

自闭症网瘾萝莉.ら 提交于 2019-12-23 20:14:27

问题


Given the following simple project:

QT += core
QT -= gui

TARGET = ConsoleTest08
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp

LIBS += -L/usr/local/lib

With this simple main.cpp file:

int main(int argc, char *argv[])
{
    return 0;
}

When running from Qt Creator, I have the following error:

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.

It runs fine from the terminal.

Here is my config:

  • OSX 10.9
  • Qt 5.5.1 clang 64 biy
  • Qt Creator 3.6.0

I lastely update to Qt Creator 3.6.0 so I suspect a bug.

I have libpng 1.6.21 installed via brew which seams to conflict with the ImageIO framework but I don't link explicitely none of them.

Any idea about what happened?


回答1:


I solved my problem by unchecking this new Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH checkbox in my project Run section:



来源:https://stackoverflow.com/questions/35390905/qt-creator-failed-on-running-program-when-linking-usr-local-lib

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!