Compiling Siphon2 for iPhone Simulator using XCode, SDK 3.1.2

120 views
Skip to first unread message

sa

unread,
Feb 7, 2010, 2:46:57 PM2/7/10
to Siphon
Hello,

Has anyone compiled Siphon2 (that's the name of the directory in the
SVN repository) for the iPhone Simulator, SDK 3.1.2, using XCode?

While I have been able to compile pjsip successfully, using the
excellent instructions at http://www.piemontewireless.net/PJSip155_and_iPhoneSDK312,
I'm unable to compile Siphon2 using XCode.

What I've done so far:

1. class-dump for AddressBookUI and Preferences (from the Simulator
directory path, as opposed to dumping the framework from the iPhone
directory path), and adding the 2 directories to Headers/.

2. Soft-linking the pjsip root directory to be at the same level as
Siphon2 (that's where the XCode project file appears to be looking for
it).

The errors I get are mainly regarding missing include files or
declarations. The first two:

1. Unable to find UINavigationController.h: for this I added the path
to the UIKit headers directory to XCode project settings, and was able
to get past this error.

2. Unable to find protocol declaration for
ABPersonViewControllerDelegate (used in ABPersonViewController.h) :
for this, I have no idea where to get this protocol declaration from.
I'm not able to find it in any of the header files in the Simulator
SDK path.

Any help on how to proceed with this compilation, or a different
method of compiling for the simulator, would be highly appreciated.

Thanks.

sa

unread,
Feb 8, 2010, 10:47:06 AM2/8/10
to Siphon
Ok, after fiddling around some more with header file paths and
compiling g729, I've gotten this to the point where the code compiles
(with lots of warnings), but doesn't link because of various pjproject-
related symbols not found.

Some examples:

"_pjmedia_tonegen_rewind", referenced from:
_on_call_state in call.o
[...]
"_pj_log_5", referenced from:
_sip_dial_with_uri in call.o
"_pjsua_acc_add", referenced from:
_sip_connect in call.o
"_pjmedia_tonegen_create", referenced from:
_call_init_tonegen in dtmf.o
"_pjsua_conf_add_port", referenced from:
_sip_ring_init in ring.o
_call_init_tonegen in dtmf.o
"_pjsua_acc_del", referenced from:
_sip_disconnect in call.o

[... many more such errors...]

"_pjmedia_tonegen_create2", referenced from:
_sip_ring_init in ring.o
symbol(s) not found
collect2: ld returned 1 exit status
line 3: ldid: command not found

I can find many of these symbols in the various pjproject libraries
that I built before starting compiling Siphon2. I removed all
pjproject-related libraries from the "Linked Libraries" section of the
project settings, and re-added everything, so XCode should know where
these library files are. However, for some reason, XCode doesn't
appear to be linking these libraries correctly with the Siphon2
target.

Any pointers on how I can proceed on this?

Thanks.

Samuel Vinson

unread,
Feb 8, 2010, 2:47:18 PM2/8/10
to sip...@googlegroups.com
You need to add static libraries of pjsip in your project.

Samuel

2010/2/8 sa <sal...@gmail.com>

Thanks.

--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siphon?hl=en.


sa

unread,
Feb 8, 2010, 5:41:57 PM2/8/10
to Siphon
Thanks for the reply.

The problem turned out to be the fact that I had built pjproject for
the iPhone device (arm target) but was using it to link to Siphon2
built for the iPhoneSimulator (i686 target). That's the reason XCode
didn't pick up those libraries.

So now I've started trying to build pjproject for the iPhoneSimulator,
and run into different problems.

Long story short, after removing references to frameworks CoreServices
and AudioUnit from aconfigure.ac, "make" for pjproject now fails at
this error:

i686-apple-darwin9-gcc -c -Wall -DPJ_AUTOCONF=1 -O2 -arch i386 -
isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator3.1.2.sdk -O2 -arch i386 -isysroot /Developer/
Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator3.1.2.sdk -DPA_USE_COREAUDIO=1 -DPA_LITTLE_ENDIAN -I. -
Isrc \
-o output/libportaudio-i686-apple-darwin9/pa_mac_core.o \
src/pa_mac_core.c
In file included from src/../../../portaudio/src/hostapi/coreaudio/
pa_mac_core.c:65,
from src/pa_mac_core.c:1:
src/../../../portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h:
64:33: error: CoreAudio/CoreAudio.h: No such file or directory


CoreAudio.h is present in the MacOSX10.5.sdk, but not in
iPhoneOSSimulator SDKs.

Not really sure how to proceed from here. Any suggestions?

Also, I guess I should repeat my previous question: has anyone
successfully compiled pjproject and Siphon2 for the iPhone OS
Simulator, SDK 3.1.2? Do you have some instructions/notes on the
entire process?

Thanks.

Samuel Vinson

unread,
Feb 9, 2010, 2:55:32 AM2/9/10
to sip...@googlegroups.com
Yes I succeed to compile for both ;-) Portaudio doesn't work on device nor on simulator ;-)

In configure.ac change
arm-apple-darwin*)
by
arm-apple-darwin* | i686-apple-darwin*)
For audio part.

In rules.mak
change
    $(RANLIB) -static -arch_only armv6 -o $(LIB) $(OBJS)
by
    $(RANLIB) -static -o $(LIB) $(OBJS)

Samuel

2010/2/8 sa <sal...@gmail.com>

sa

unread,
Feb 9, 2010, 1:43:30 PM2/9/10
to Siphon

Thanks a lot, the step I was missing was treating the i686 target the
same as arm in aconfigure.ac. I ended up building Mac version of pjsip
and it compiled and linked successfully with Siphon2, but clearly
building for the simulator was the right way to go.

I can compile pjsip and Siphon2 for simulator now.

Running them on the simulator, however, is causing problems. More on
that later.

Reply all
Reply to author
Forward
0 new messages