Q:

PJSIP on iOS, compiler error of "undeclared type `pj_thread_t`"

I had built PJSIP 2.7.1 and was integrating it for an iOS app written in Swift. Everything worked so I believed it was built the right way, all libs and headers were in the right place too, until one day I was trying to call lib functions from an external thread so I had to register this thread by using pj_thread_register() and declared a pj_thread_t type variable, the compiler started to complain about that the type pj_thread_t was undeclared.
I found the pj_thread_t was declared in pj/types.h and was defined in pj/os_core_linux_kernel.c. The types.h was already included in the header search path and I supposed it should work. I guess I must have missed something here. 

A:

I met the same problem in my Swift project. My solution is create a kind of wrapper file in ObjC. Swift and ObjC works with memory in different ways. This is why my wrapper works good. Now I can call pj_thread_t inside my wrapper file.
pjsip (C) --> MyWrapper file (ObjC) --> myProject' files (Swift)

MyProject-Bridging-Header.h file contain only one row:
#import "MyWrapper.h"

