2
我有一個用C和Objective-C編寫的簡單程序。它由坐我的桌面上,我從終端編譯幾個文件使用此:爲簡單的命令行程序編譯Apple框架
gcc -framework Foundation audio.m WavReader.m WavFileCreator.m -o audio
我想生成我的代碼的音頻文件,並要做到這一點需要AudioToolbox框架,其中包括我在使用.h文件
#import <AudioToolbox/AudioToolbox.h>
當我編譯我得到這個錯誤:
WavFileCreator.m: In function ‘createNewWAV’:
WavFileCreator.m:61: warning: initialization makes integer from pointer without a cast
Undefined symbols for architecture x86_64:
"_AudioFileCreateWithURL", referenced from:
_createNewWAV in cckeb4pu.o
"_AudioFileWriteBytes", referenced from:
_createNewWAV in cckeb4pu.o
"_AudioFileClose", referenced from:
_createNewWAV in cckeb4pu.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
忽略第61行的錯誤,我認爲這是一個單獨的問題。其他錯誤似乎無法訪問框架。我該如何解決這個問題?