[Flac-dev] Compiling in Xcode
brianw at sounds.wa.com
Tue Jul 20 23:24:11 PDT 2010
On Jul 20, 2010, at 22:28, Dmitry Kichenko wrote:
> I'm not sure whether this is the best place to send the question,
> but since I'm mostly interested in FLAC and there didn't appear to
> be a better place for it.. here goes.
I think flac-dev is the perfect place for questions about building
flac. But the answers are probably going to be geared towards the
FLAC point of view rather than the Xcode point of view.
> I pulled the latest source code from the SVN repo along with all
> the external dependencies including FLAC. I've been able to compile
> the FLAC.framework file using the 10.5 SDK in Xcode 3.2 with a
> dozen or so warnings, but have been unable to compile the entire
> Xiph.org QuickTime component project. It seems the dependencies
> compile just fine, but then things explode with a fountain with
> hundreds errors all of the same nature, choking seemingly on struct
> definitions, for the most part:
> error: expected specifier-qualifier-list before
> importer_types.h:99:0 /Users/dmitry/Developer/objc/xiph-qt/build-
> macosx/../OggImport/src/importer_types.h:99: error: syntax error
> before 'Track'
> are some of the repeating examples of errors.
> I've tried building PPC, 32 and x64 builds, as well as the
> universal ones, but they all fail with the same errors. Would
> anyone be able to point me in the right direction? It seems like
> I'm just missing a compiler argument or a project build setting.
The flac sources are distributed in a configuration that is designed
primarily for building from the command-line. I seem to recall that
there might have been an Xcode project in there at some point, but if
there was, it never worked well. In all honesty, I may be getting
confused with some other open source project on that last point.
In any event, if you want to compile flac on OSX, then just use
Frankly, if you want to compile flac in Xcode, and you're getting
mysterious errors, then it's probably a good sign this is a task
better left to the experts. It would be great if someone could set
this up, but it's not necessary since the command line is available.
I've been using Xcode since it was called ProjectBuilder, and I know
the environment quite well. However, I have found that it's usually
more work than anticipated to convert a command-line build
environment to a GUI Xcode environment. It certainly should be
simple, but it's probably not really worth anyone's time. That said,
if anyone does get it working, please share your Xcode project files
so that Josh can hopefully incorporate them into the source release.
As for my OSX applications which use FLAC, I always add libFLAC.a to
my project, as compiled and installed by the command-line makefile.
In other words, rather than compiling the entire source for flac into
my applications, I simply link to the library. I have not used the
libFLAC++.a because I prefer not to mix Objective C and C++, but I
can confirm that the Standard C libFLAC.a works perfectly fine for
encoding and decoding FLAC files using the standard API.
By the way, I created an Installer.app package which installs the
entire flac command-line tools and libraries into appropriate
directories, and then you can just link your OSX applications to the
precompiled library. This is the OSX package that is available via
links at flac.sourceforge.net
More information about the Flac-dev