openFrameworks (Xcode) のインストール
http://openframeworks.cc/download/ からダウンロードして解凍したら、好きなディレクトリに丸ごと配置したら完了です。
なお事前に Xcode を OS X App Store でダウンロードし、ターミナルで事前に以下のコマンドを打って、指示に従いコマンドラインツールをインストールします。
$ xcode-select --install
projectGenerator_osx ディレクトリの下の、「projectGenerator」を実行して、新規プロジェクトを作成して作業開始していきます。
詳しくはXcode でのインストール方法のページを参考にします。
下記のようなエラーが出る場合:
Xcode のデフォルトでは 32-bit / 64-bit アーキテクチャ向けにビルドしようとしていますが、openFrameworks は 64bit 対応がまだなので(github のブランチでは 64bit 対応が進んでいます)、プロジェクト設定を 32bit のみにすれば成功するようになります。
Xcode の PROJECT 設定>Build Settings>Architectures>「32-bit Intel (i386) – $(ARCHS_STANDARD_32_BIT)」を選択してください。
Undefined symbols for architecture x86_64: "ofImage_<unsigned char>::ofImage_()", referenced from: ___cxx_global_var_init6 in ofxPanel.o ___cxx_global_var_init7 in ofxPanel.o "ofTrueTypeFont::~ofTrueTypeFont()", referenced from: ___cxx_global_var_init11 in ofxBaseGui.o "ofColor_<unsigned char>::limit()", referenced from: ___cxx_global_var_init6 in ofxBaseGui.o ___cxx_global_var_init7 in ofxBaseGui.o ___cxx_global_var_init9 in ofxBaseGui.o ___cxx_global_var_init10 in ofxBaseGui.o "ofImage_<unsigned char>::~ofImage_()", referenced from: ___cxx_global_var_init6 in ofxPanel.o ___cxx_global_var_init7 in ofxPanel.o "ofGetElapsedTimef()", referenced from: ofApp::draw() in ofApp.o "ofColor_<unsigned char>::ofColor_(float, float)", referenced from: ___cxx_global_var_init6 in ofxBaseGui.o ___cxx_global_var_init7 in ofxBaseGui.o ___cxx_global_var_init8 in ofxBaseGui.o ___cxx_global_var_init9 in ofxBaseGui.o ___cxx_global_var_init10 in ofxBaseGui.o "ofSetColor(int, int, int)", referenced from: ofApp::draw() in ofApp.o "ofColor_<unsigned char>::~ofColor_()", referenced from: ___cxx_global_var_init6 in ofxBaseGui.o ___cxx_global_var_init7 in ofxBaseGui.o ___cxx_global_var_init8 in ofxBaseGui.o ___cxx_global_var_init9 in ofxBaseGui.o ___cxx_global_var_init10 in ofxBaseGui.o "ofRect(float, float, float, float)", referenced from: ofApp::draw() in ofApp.o "ofSetupOpenGL(int, int, int)", referenced from: _main in main.o "ofColor_<unsigned char>::black", referenced from: ofApp::draw() in ofApp.o "ofColor_<unsigned char>::white", referenced from: ofApp::draw() in ofApp.o "ofDrawBitmapStringHighlight(std::string, int, int, ofColor_<unsigned char> const&, ofColor_<unsigned char> const&)", referenced from: ofApp::draw() in ofApp.o "ofTrueTypeFont::ofTrueTypeFont()", referenced from: ___cxx_global_var_init11 in ofxBaseGui.o "ofRunApp(ofBaseApp*)", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
ソースファイル
oF のプロジェクトで使うファイルはテンプレートプロジェクトに用意されている main.cpp、testApp.h、testApp.cpp のみになることが多いかもしれません。
普段スケッチやクリエイティブコーディングでは
testApp.cpp にコードを書き加えていくことになるでしょう。