iOS Question Undefined symbols for architecture arm64

sfsameer

Expert
Licensed User
Longtime User
Hello everyone :)

We are facing the following error when use inline java objective c :

inline Objective C:
 "_pjsua_acc_add", referenced from:
      -[b4i_main registerPjSipWithServer:user:password:] in b4i_main.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The above error occurs once we add the following code :
inline Objective C:
 pj_status_t status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);

and now we are stuck :( , we have search the forum and not a single result showed so your help is really appreciated :)

Thank you,
Saif
 

sfsameer

Expert
Licensed User
Longtime User
*We are using Hosted builder
*We tried 32-bit and 64-bit and the same error shows up

**I think we should reference .a file but am not sure where and how
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
Where does pjsua_acc_add come from?
pjsua_acc_add comes from PJSIP library

Also the function referenced here :
B4X:
PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config acc_cfg,
                   pj_bool_t is_default,
                   pjsua_acc_id p_acc_id);
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
There is no such library on the hosted builder.
It's not a B4i library erel , we are wrapping up a library called PJSIP : https://www.pjsip.org/
We have created an inline objective c based on this library and after 1 thousand error we finally got it to work, the only problem now is the above error that keeps showing.

So what do you suggest? :)
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
Okay we found the reference of the above in :
libpj-arm-apple-darwin9.a

How can we add the file :libpj-arm-apple-darwin9.a or reference it in B4i

*My apologies for asking too many questions but this is the first time we are using a library this complicated in B4i :)
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
Did you check arhitectures in .a file using lipo -info ?
Some details: https://www.b4x.com/android/forum/t...r-x86_64-symbols-not-found.114891/post-717978
Thank you for taking the time :)

in PJSIP documentation page they say they support the following :
armv6, armv7, armv7s, arm64, and so on

so the above are supported, the only thing left to solve the problem is referencing the .a file in B4i but we don't know how, could you please "if it's not taking too long of your time" explain how to reference the .a file in B4i?

Thank you,
Saif
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
B4X:
how to reference the .a file in B4i?

It seems to me that there are no references. B4i IDE looks names of xml files inside Libraries subfolder. For iAny.xml it expects iAny.h and libiAny.a.
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
B4X:
how to reference the .a file in B4i?

It seems to me that there are no references. B4i IDE looks names of xml files inside Libraries subfolder. For iAny.xml it expects iAny.h and libiAny.a.
This file needs to be referenced :
"libpjsip-arm-apple-darwin9.a" which contains the function "pjsua_acc_add" and many other functions

We will try to do the following, we will put the inline objective c code in xcode and reference the .a file there and create a library for B4i and see how it goes :)

Thank you for taking the time to reply :)
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
*Just for clarification what do we mean by reference :
1617724428142.png


The .a files should be added to the project to get the embedded functions which we are not able or not knowing how to do that using B4i
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Probably, you talk about dependsOn

xml includes (for example)
<dependsOn>AVFoundation.framework</dependsOn>
<dependsOn>AudioToolbox.framework</dependsOn>
.h Includes
//~dependson:AVFoundation.framework
//~dependson:AudioToolbox.framework
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
Probably, you talk about dependsOn

xml includes (for example)
<dependsOn>AVFoundation.framework</dependsOn>
<dependsOn>AudioToolbox.framework</dependsOn>
.h Includes
//~dependson:AVFoundation.framework
//~dependson:AudioToolbox.framework
You are correct if we were using .framework but we aren't, we are using .a files linked binary libraries which is different :)
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
Send me the third party library files and I'll upload them to the hosted builder.
You have no idea how much that would help us!

and as a way to say thank you we will release the full IOS source code project for free to help people to use VoIP SIP in B4i for free :)

.a and .h files (Copy and paste the url in your browser and it will start downloading) :

*Could you please notify us once it's uploaded so we can proceed with the development :)

Thank you ♥
Saif
 
Upvote 0

sfsameer

Expert
Licensed User
Longtime User
It is online. Same structure as you sent it.

In the long run, it is easier to develop libraries with a local Mac as you have more flexibility.
Dear erel, first of all thank you very very much!

But we are still getting the same error :

B4X:
Undefined symbols for architecture arm64:
  "_pjsua_acc_config_default", referenced from:
      -[b4i_main registerPjSipWithServer:user:password:] in b4i_main.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
Upvote 0
Top