I'm trying to port FLAC encoder using Adobe Alchemy for use in flash but can't figure out where the problem is.
I'm using Alchemy for Cygwin on Windows. It is properly installed and configured.
The following are the steps that I have followed in order to port FLAC encoder:
- Download the latest version of FLAC sources (1.2.1)
- Configure FLAC sources (
./configure --enable-static=true --enable-shared=false
) with the alchemy enabled (alc-on
before configure) - Compile libFLAC with the alchemy enabled (
make
in src/libFLAC folder) - Copy header files and compiled static library (libFLAC.a) to alchemy folders (${ACLHEMY_HOME}/usr/local/include and ${ACLHEMY_HOME}/usr/local/lib respectively)
- Finally, compile SWC in that way:
gcc encodeflac.c -O3 -Wall -swc -lFLAC -o encodeflac.swc
or (whatever)gcc encodeflac.c -O3 -Wall -swc -lflac -o encodeflac.swc
encodeflac.c is the modified version of example included in FLAC sources (examples/c/encode/file/main.c) and adopted to work with ActionScript ByteArrays.
The swc will compile without warnings or errors. But the final swc size is only 85kb, while the static library size (libFLAC.a) is about 1mb! Also, the encoding is not working.
I get the following error when trying to use it in AS:[Fault] exception, information=Undefined sym: FLAC_stream_encoder_new
Does it mean that the static library is not included in swc? Why?
Thanks in advance.