I was easily able to compile and run the sample code. But when I add the following to my code:
the compile fails. I get the following error:
Expected ‘=’,’,’,’;’,’asm’ or ‘attribute‘ before ‘FMOD’
This is at line 20 of fmod.hpp. The line reads:
I’m still a little new to Xcode but I think that there’s something wrong with the configuration of my target. I compared what I have with the sample code and thought I match everything up. However, there are numerous options that aren’t available in my drop down. Is there any documentation that explains how to create the project?
- bitblit asked 8 years ago
Thanks Peter. That was definitely an issue i ran into later, but the source my problem was more complex than that. I went through a lot of trial and error get to the working Xcode 4.2 setup, but finally cracked it. I also wrote a blog post about it and though i would post it here for posterity.
http://www.zen-sign.com/adding-fmod-ios … xcode-4-2/
Header files are not compiled, only code files such as .c and .cpp (or in this case .m and .mm files) are compiled. What the compiler does is it interprets the #include (or in this case #import) preprocessor directive by inserting the entire header into the code file at that point. The result of the preprocessor is a big blob of code (made up of one code file and any number of headers) and is known as a [url=http://en.wikipedia.org/wiki/Translation_unit_%28programming%29:2dx6e86p]translation unit[/url:2dx6e86p] and that whole thing is compiled as one.
So with regard to your question of whether you can include C++ code in a header, you can if that header is [i:2dx6e86p]only[/i:2dx6e86p] imported by files with the .mm extension.
- Guest answered 7 years ago
Please login first to submit.