我想NSRunningApplication
在 Mac OS X 上的 Qt 应用程序中使用。我试图将这些头文件包含在mainwindow.cpp
:
#include Cocoa/Cocoa.h
#include Foundation/Foundation.h
#include AppKit/NSRunningApplication.h
#include AppKit/NSWorkspace.h
#include ApplicationServices/ApplicationServices.h
#include "CGWindow.h".
还包括在.pro
文件中
INCLUDEPATH += /System/Library/Frameworks/Foundation.framework/Headers
但这会产生错误:stray '@' in program
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6,
/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:8 : error: stray '@' in program.
我的问题是:
如何NSRunningApplication
在我的应用程序中使用?要包含哪些文件以及在何处/如何删除这些错误?