DevBandit at gmx.net
2010-Apr-09 17:50 UTC
[Speex-dev] How to compile speex with XCode (for iPhone App)?
Hi, I'm currently trying to use Speex on the iPhone but have some difficulties to get Speex compiled with XCode. Unfortunately I'm very new to XCode and it would be great if someone could give me a hint what the problem is. Here is what I did in detail: 1. Downloaded the Source Code speex-1.2rc1.tar.gz from www.speex.org 2. Start Xcode 3.1.4 3. File > New Project ... 4. iPhone OS > Application > View-based Application > Save as "Speex iPhone Test" 5. Righ-Click the project file in the Xcode left hand pane > Add > Existing Files ... 6. Select folder Downloads > speex-1.2rc1 > include > speex and select folder Downloads > speex-1.2rc1 > libspeex select file Downloads > speex-1.2rc1 > config.h.in click button "Add" 7. Selected "Copy items into destination group's folder (if needed), click "Add" 8. Rename config.h.in to config.h (or should I use a different "config.h"?) 9. Double click the project file in Xcode's left hand pane 10. Change value of setting "Header Search Paths" to "**" 10. Choose "Add User-Defined Settin" from the * menu at the bottom 11. Setting: GCC_PREPROCESSOR_DEFINITIONS, Value: HAVE_CONFIG_H ---> If I now choose "Build > Build" from the Xcode menu I get 30 warnings and 155 errors. Most of the errors are error: expected '=',',',';','asm' or '__attribute__' before 'void' or error: #error You now need to define either FIXED_POINT or FLOATING_POINT Any idea which settings I have to change in order to get the speex code compiled? I would really appreciate any help. Many thanks & regards, Nils -- GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Peter Burtis
2010-Apr-10 03:47 UTC
[Speex-dev] How to compile speex with XCode (for iPhone App)?
On Apr 9, 2010, at 1:50 PM, DevBandit at gmx.net wrote:> ---> If I now choose "Build > Build" from the Xcode menu I get 30 warnings and 155 errors. > Most of the errors are > error: expected '=',',',';','asm' or '__attribute__' before 'void' > or > error: #error You now need to define either FIXED_POINT or FLOATING_POINT > > Any idea which settings I have to change in order to get the speex code compiled?I have an iphone project with speex built in. I had to add these macros to the preprocessor definitions: Setting: GCC_PREPROCESSOR_DEFINITIONS Values: USE_KISS_FFT=1 EXPORT= FIXED_POINT=1 The EXPORT macro takes care of the "expected '=',',',';','asm' or '__attribute__' before 'void'" error by simply making the word EXPORT disappear throughout the source; I have no idea if this is the best way to handle it or not, it seems reasonable to me since I'm building it into an executable, but I admit to being in way over my head when it comes to building C libraries. After that I had to add the speex include directory to the project's search path like this: Setting: HEADER_SEARCH_PATHS Value: $(PROJECT_DIR)/speex/include (Assuming, of course, that you've copied the whole speex project folder into your project directory.) As I recall that was pretty much all it took to get XCode to build it. I don't know if it's the "proper" way to do it, but it works. Peter Burtis -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3675 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20100409/6e51403e/attachment.bin