Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to build mp4v2 for iphone

I'm new to ios development, and I want to use the mp4v2 library. I have successfully compiled for iphone simulator, i386, but am having trouble compiling for the iphone architecture. Configuring/Make-ing for i386 was easy:

./configure --disable-gch --enable-ub=i386

However, using armv6/7 as a tag didn't work

./configure --disable-gch --enable-ub=armv6,armv7

While configuring worked, the make command led to the error below:

/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -arch i386 -arch armv6 -arch armv7 -I./include -I./include -I. -I.  -Wall -Wformat -g -O2 -fvisibility=hidden -c -o src/3gp.lo src/3gp.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -arch i386 -arch armv6 -arch armv7 -I./include -I./include -I. -I. -Wall -Wformat -g -O2 -fvisibility=hidden -c src/3gp.cpp  -fno-common -DPIC -o src/.libs/3gp.o
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/b6/vmqqncd55k79nb1nc4x30nwr0000gn/T//cctU2lnr.out
make: *** [src/3gp.lo] Error 1

How do I compile for iphone?

like image 923
Rishi Avatar asked Nov 03 '22 23:11

Rishi


1 Answers

I guess that this error is caused by trying to find cross compiler from system root path /usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2 instead of from Developer document. A little stupid solution is create a symbolic link llvm-gcc-4.2 in system root path /usr, pointing to the real path.

like image 172
user1600668 Avatar answered Nov 15 '22 05:11

user1600668