2012-03-01 189 views
0

我已經創建了一個包含Qt的應用程序文件。它包含openGL,Qt和C++代碼。未在其他mac上運行的應用程序文件

我的親文件看起來像這樣:

TEMPLATE = app 
TARGET = 
DEPENDPATH += . 
INCLUDEPATH += . 


# Input 
HEADERS += openglscene.h \ 
glwidget.h 

QT += opengl 

OTHER_FILES += 

RESOURCES += \ 
    images.qrc 

mac: LIBS += -framework GLUT 
else:unix|win32: LIBS += -lGLUT 

FORMS += 

我收到以下錯誤消息,嘗試運行在不同的MAC應用程序文件時:

Exception Type: EXC_BREAKPOINT (SIGTRAP) 
Exception Codes: 0x0000000000000002, 0x0000000000000000 

Application Specific Information: 
dyld: launch, loading dependent libraries 

Dyld Error Message: 
Library not loaded: /Developer/QtSDK/Desktop/Qt/473/gcc/lib/QtOpenGL.framework/Versions/Current/QtOpenGL 
    Referenced from: /Users/USER/Desktop/*/model.app/Contents/MacOS/model 
    Reason: image not found 

其他Mac電腦不具備Qt安裝。因爲看起來我需要包含一個openGL框架。這怎麼可能讓我的應用程序的其他用戶能夠使用它?

回答

1

您需要在應用程序包中包含所有應用程序的依賴項,包括Qt。 qmake本身並不關心這一點。 Qt帶有一個小工具,macdeployqt,它可以做你需要的。更復雜的解決方案是使用CMake和DeployQt4.cmake

相關問題