Help setting a project from scratch using ofxFenster in XCode 4

I can compile all ofxFenster examples in the bundle but when I try to create a project from scratch and include the addon I get the following errors:

I may be missing an extra step in the setup, all I’m doing is drag the ofxFenster addon to my project, what else do I need to do?

Any help will be much appreciated

Hey Ricardo

It looks like you’re missing the libGhost for OS X in your project. https://github.com/underdoeg/ofxFenster/blob/master/libs/ghost/lib/osx32/libGhost32.a

Dragging and dropping it to xcode should work but I have encountered buggy situations where xcode tried to use the linux or windows libraries and ignored those for osx. Deleting all other ghost libs in the project and readding the right one might work.

The lib is there with all the other versions, so I just delete the other OS ghost versions and leaving OSX only should work, the weird thing is that those libs are included in the example projects as well and they compile, I’ll give it a go and let you know how it goes.

Many thanks for your help!

I’m not sure, but I think in the examples I manually added the osx lib to the linked libraries dialog in the compile settings.

You were right, I’m still getting the same error though, I removed all libGhostXX.a references and manually drag the osx32 version and same errors appeared for some reason looks like is always looking for the linux version as this warning say "ignoring file /Users/nardove/Programming/openFrameworks/of_0071_osx_release/addons/ofxFenster/libs/ghost/lib/linux/libGhost32.a, file was built for archive which is not the architecture being linked (i386)"
, do I need to tell my project about this somewhere else?

Are you on XCode 3 or 4? I only know my way around 3 and I can’t exactly tell where I changed stuff so that it works. I don’t have access to a mac right now. But usually you should find some more settings in the target settings. I usually add the libraries here and delete all that are unused http://blog.mugunthkumar.com/wp-content/uploads/Xcode.png. But I think XCode either has some annoying bugs when it comes to statically linked libraries or some secret space where more settings are stored. Maybe someone else has had this problems as well?

I’m on XCode 4 :frowning: there most be something else going on, I took one of your example apps and put it on a different location remove the addon and drag it back in and it works but if I do it from an emptyExample app it doesnt work, I run out of options, hopefully some one may give us a hint.

Thanks again Phillip

To work from OF emptyExample, everything I need is:

  • Put ofxFenster o addons. (obvious)
  • Change Project.xcconfig:
  
OF_PATH = ../../..  
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"  
LIB_GHOST="$(OF_PATH)/addons/ofxFenster/libs/ghost/lib/osx32/libGhost32.a" //this*  
OTHER_LDFLAGS = $(OF_CORE_LIBS) $(LIB_GHOST) //this*  
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)  

  • Change main.cpp
  
#include "testApp.h"  
#include "ofxFensterManager.h"  
#include "ofAppGlutWindow.h"  
int main(){  
    ofSetupOpenGL(ofxFensterManager::get(), 800, 600, OF_WINDOW);			  
    ofRunFensterApp(new testApp());      
}  

Thats it.

Thanks oseias. That also worked for me in XCode 3.2.6

i am on mbp osx 10.8.2 with xcode 4.6.1
i noticed my main project folder’s name needed to not have any spaces, otherwise it did not compile.

i also had to go to build settings, press the add build settings button and add LIB_GHOST and “$(OF_PATH)/addons/ofxFenster/libs/ghost/lib/osx32/libGhost32.a” to the settings.