2012-02-05 5 views
3

私はRtMidi(http://www.music.mcgill.ca/~gary/rtmidi/)を使用するプロジェクトに取り組んでいます。以下のコマンドを使って、ターミナルのサンプルコードをコンパイルすることができます。XCodeで-D__MACOSX_CORE__を指定する方法

g++ -Wall -D__MACOSX_CORE__ -o midiprobe midiprobe.cpp RtMidi.cpp \ 
    -framework CoreMidi -framework CoreAudio -framework CoreFoundation 

ただし、XCodeでコードを使用する必要があります。 CoreMidi、CoreAudio、CoreFoundationの3つのフレームワークを追加しましたが、-D__MACOSX_CORE__をどうすればいいのか分かりません。

エラー:

Undefined symbols for architecture x86_64: "vtable for RtMidiIn", 
referenced from: 
     RtMidiIn::RtMidiIn(std::string, unsigned int) in RtMidi.o "RtMidiIn::initialize(std::string const&)", 
referenced from: 
     RtMidiIn::RtMidiIn(std::string, unsigned int) in RtMidi.o "vtable for RtMidiOut", 
referenced from: 
     RtMidiOut::RtMidiOut(std::string) in RtMidi.o "RtMidiOut::initialize(std::string const&)", 
referenced from: 
     RtMidiOut::RtMidiOut(std::string) in RtMidi.o 
ld: symbol(s) not found for architecture x86_64 clang: 
error: linker command failed with exit code 1 (use -v to see invocation) 

誰もがこの上で私を助けることができますか?

答えて

2

ターゲットのビルド設定に移動し、値__MACOSX_CORE__のプリプロセッサマクロを作成します。

enter image description here

関連する問題