ofxFenster : not compiling on osX

Hi,
I’m giving some help to adapt ofxFenster to osx.
Has someone something about errors on (from the example)

  • NSObjCRuntime.h
  • Unknown type name ‘NSString’
  • Unknown type name ‘Protocol’

Help appreciated
Cheers

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:412:54: Use of undeclared identifier 'aSelectorName'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:414:19: Unknown type name 'NSString'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:415:43: Use of undeclared identifier 'NSString'; did you mean 'NewString'?

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:415:53: Use of undeclared identifier 'aClassName'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:417:19: Unknown type name 'NSString'

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:417:50: Unknown type name 'Protocol'

clang: warning: -lpthread: 'linker' input unused
In file included from /Users/dudleysmith/Dude_s_Place/_OF/openFrameworks/addons/ofxFenster/src/ofxFensterManager.cpp:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:409:1: error: expected unqualified-id
@class NSString, Protocol;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:411:19: error: unknown type name 'NSString'
FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:412:44: error: use of undeclared identifier 'NSString'; did you mean 'NewString'?
FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
                                           ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:147:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h:155:1: note: 'NewString' declared here
NewString(ConstStr255Param theString)                         __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA);
^
In file included from /Users/dudleysmith/Dude_s_Place/_OF/openFrameworks/addons/ofxFenster/src/ofxFensterManager.cpp:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:412:54: error: use of undeclared identifier 'aSelectorName'
FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
                                                     ^

etc…

I usually see errors like this when I have a .cpp file that contains objective c / objective c++ code and I haven’t told xcode to compile it as objective-c++. files that mix objective c and c++ need to be compiled as objective c++, even if they are called .cpp. you can force a file like that via the sidebar in xcode, where for a specific file you can set the type

hope that helps!

1 Like

Hi Zach that works,

Now I get a BAD ACCES error on the first line in main.

Let’s see more details in this github thread

I haven’t tried to compile it, so I’m just trying to debug on a napkin here, but it looks like maybe somewhere there needs to be a call to glfwInit () before you start calling glfw functions.

hi, don’t know. I have it some times…
all’s almost clear, now

I managed to get the example project working under of0.8 with xcode5 - ofZach was right, needed to set the following files to objective c instead of c++

ofxFensterManager.cpp and
ofxFenseter.cpp

I’m not seeing the"BAD ACCESS" @new_dudley is - I’ve created a PR but it seems @underdog is a bit snowed under (there are 2 other PR’s that have been waiting months) you can access it here for now - https://github.com/sheridanis/ofxFenster