iOS Tutorial [Objective C] Writing libraries for B4i

B4i libraries are written in Objective C. You need to use a Mac with Xcode and you need to know Objective C.
From my experience it is more difficult to write B4i libraries compared to B4A / B4J libraries.

Libraries are made of three files: library.a, library.h and library.xml.

The xml file is created automatically from the h file using the tool attached to this thread.
This is a command line tool written with B4J. You need to pass two arguments: path to the h file and path to the output file.
For example:
B4X:
java -jar B4Ih2xml.jar test.h test.xml
Note that this tool parses the file line by line. It will not handle properly signatures that span multiple lines.

The a and h files should be eventually copied to the Libs folder on the Mac and the xml file should be copied to the IDE libraries folder.

Libraries should include two binaries: arm64 and armv7.

Supported types

The following types can be exposed to B4i: BOOL, unsigned char, unichar, short, int, long long, float, double and any objc object. Other types cannot be directly exposed.

Header file

The xml is derived from a single h file. This means that all the interfaces that should be exposed need to be defined in this h file.
You need to add all kinds of attributes to the h file (similar to B4A annotations).
This is done by writing a comment that starts with:
//~

For example:
B4X:
//~shortname:LocationManager
//~event:LocationChanged (Location1 As Location)
//~event:AuthorizationStatusChanged (Status As int)
//~event:LocationError
//~event:HeadingChanged (MagneticHeading As Double, TrueHeading As Double)
//~event:AllowCalibration As Boolean
//~version:1.00
//~dependsOn:CoreLocation.framework
@interface B4ILocationManager : NSObject<CLLocationManagerDelegate>

The attributes are case-insensitive and the values are trimmed from extra spaces.

Attributes
  • ShortName - The B4i type name.
  • Event - The type events. Can be used multiple times.
  • Version - library version
  • Author - library author
  • RaisesSynchronousEvents - Tells the compiler that calling this method may cause an event to be raised (before the code returns).
    //~RaisesSynchronousEvents:true
  • ObjectWrapper - If the type is a thin wrapper and it inherits from B4IObjectWrapper then this attribute should be set with the native type name.
    //~ObjectWrapper:CLLocation*
  • DependsOn - Tells the compiler that this library depends on other frameworks or a files.
    //~dependsOn:CoreLocation.framework
    If the framework is an external framework then you need to add .3:
    //~dependson:GoogleMaps.framework.3
    DependsOn with a file (the extension is omitted):
    //~dependson:GoogleAdMobAds
Methods

The exposed methods can have any number of parameters. However the parameter names should be empty:
B4X:
- (B4IMarker *)AddMarker: (double)Lat :(double)Lon :(NSString *)Title;

B4IObjectWrapper

If your object is a thin wrapper over a different object then you can inherit from B4IObjectWrapper. Such objects should not have any instance variables (including not properties that are implicitly back by a variable).
You need to create a class method named getClass that returns the native object class:
B4X:
+(Class)getClass {
  return [CLLocation class];
}

Don't use this type if you are not sure.


Raising events / B4I object

The B4I object is similar to B4A/B4J BA object. You use this object to raise events.
B4IObjectWrapper includes several class methods that help with raising events. You can use it even if your class doesn't subclass B4IObjectWrapper.

The first method is:
B4X:
[B4IObjectWrapper setBIAndEventName:self :bi :EventName];
This method takes the B4I object and the EventName parameter and stores them in the object associated map. The bi object is stored with a weak reference.
It is important to remember that the bi and EventName are tied to the object passed to this method. In this case it is 'self'.

Raising event:
B4X:
[B4IObjectWrapper raiseEvent:self :@"_authorizationstatuschanged:" :@[@((int)status)]];
Don't forget to include the colons in the method name!

Two similar methods: raiseUIEvent and raiseEventFromDifferentThread. These methods send a message to the message queue which will cause the event to be raised when the message is processed.

Tips

- Add a reference to iCore.h in your library project.

Two libraries projects are attached. The iLocation library and iAdMob library.

Latest version of iAdMob is available here: https://github.com/AnywhereSoftware/B4i_iAdMob
 

Attachments

  • Libraries.zip
    101.8 KB · Views: 1,213
  • B4Ih2xml.jar
    98.2 KB · Views: 855
Last edited:

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I need to send a Panel to my new library and this panel to be a UIView.

Like my AwesomeMenu Library but change the menu by this Panel.

Look in this images:

I have this in AwesomeMenu, I create a menu based in my own objectiveC view
Awesomemenu1.png


But I need receive Panel from B4i to put this in same place of menu
Awesomemenu2.png
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I try:

Dim no As NativeObject = objCombo
objCombo.colorBorder = no.ColorToUIColor(Colors.Magenta)


and

Dim no As NativeObject
objCombo.colorBorder = no.ColorToUIColor(Colors.Magenta)



But not working!

In the objective side I have:
@property (nonatomic, readwrite)UIColor* colorBorder;



and the Error is:

Sending data to remote compiler. Error
B4i line: 40
objCombo.colorBorder = no.ColorToUIColor(Colors.Magenta)
no visible @interface for 'B4IComboBox' declares the selector 'setcolorBorder:'



[self._objcombo setcolorBorder:[_no ColorToUIColor:[[self.__c Colors] Magenta]]];
~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
 

Haris Hafeez

Active Member
Licensed User
Longtime User
Hello All,

Do we need to copy all the .h files that our library needs to the folder where the B4IH2XML tool can find them? If I have a third party library, which files from that library does the B4iH2xml tool need?

I'm getting the following error when using the tool to create xml. I have got all the .h files in the folder where I'm executing it.

B4X:
parser._parsetype (java line: 695)
java.lang.NullPointerException
    at b4j.example.parser._parsetype(parser.java:695)
    at b4j.example.parser._parsemethod(parser.java:527)
    at b4j.example.parser._parseline(parser.java:433)
    at b4j.example.parser._parseh(parser.java:290)
    at b4j.example.parser._parseimport(parser.java:315)
Thanks.
 
Last edited:

Haris Hafeez

Active Member
Licensed User
Longtime User
Sorry I forgot to mention that I have created a wrapper that I'm passing to the xml tool.
So in light of this, do I need to put all the header files that my wrapper is using as well as the header files that the wrapped library itself is referencing?
 

Haris Hafeez

Active Member
Licensed User
Longtime User
You only need to convert the h file created for the wrapper.
That's exactly what I did. I ran the command line tool passing it the name of my .h file and the output .xml file but as you can see from the stack trace above, it's trying to read the imports. The tool failed with a file not found exception when I hadn't copied the header file used by the wrapper.

Is there a way to turn the log on for the h2xml tool?

Thanks.
 

Haris Hafeez

Active Member
Licensed User
Longtime User
UPDATE: My bad. I think what I failed to realise was that in order to build a library, anything that is exposed outside of our wrapper header file needs to be a wrapped type.
I was directly using a delegate in the header file which was causing the issues.

I still have some testing to do so hopefully...
 
Last edited:

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Erel,

I´m creating another library for iOS, but this on depend of external library, so, I just put the dependencies on .H like instructions but not working, like this:

I try

//~dependson:libetpan-ios (without extension)

and

//~dependson:libetpan-ios.a (with extension)


This library is in B4i-MacServer/Libs in my server


When I compile I got this error


Ld Payload/POP3SAMPLE.app/POP3SAMPLE normal arm64
cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -L../../Libs -F/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -F../../Libs -filelist /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE.LinkFileList -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lCore -framework Foundation -framework CoreGraphics -framework UIKit -lpop3 -framework AVFoundation -llibetpan-ios -liDebug -Xlinker -dependency_info -Xlinker /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE_dependency_info.dat -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app/POP3SAMPLE
ld: library not found for -llibetpan-ios


BTW: In my test with this library in another project directly in XCODE works perfectly (it´s in Build Phases->Link Binary With Libraries)


Thanks



Alberto Iglesias
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
OK, this step is ok now, but after this I have this problem when compiling:

In a simple test building a app calling my library (in XCODE), its working perfectly!


Parsing code. 0.06
Compiling code. 0.33
Compiling layouts code. 0.11
Compiling debugger engine code. 2.82
Building Xcode project 0.40
Sending data to remote compiler. Error
Error: security: SecKeychainDelete: The specified keychain could not be found.
Out: Build settings from command line:
ARCHS = arm64
CODE_SIGN_IDENTITY = iPhone
CONFIGURATION_BUILD_DIR = /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload
OTHER_CODE_SIGN_FLAGS = --keychain iglesias
PRODUCT_NAME = POP3SAMPLE
PROVISIONING_PROFILE = 8fe2061a-8243-496c-8daa-118492f5bb7d
=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===
Check dependencies
warning: all apps should include an armv7 architecture (current ARCHS = "arm64").
Write auxiliary files
/bin/mkdir -p /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE.LinkFileList
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-own-target-headers.hmap
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-project-headers.hmap
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-all-target-headers.hmap
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-all-non-framework-target-headers.hmap
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE.hmap
write-file /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-generated-files.hmap
Create product structure
/bin/mkdir -p /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app
ProcessInfoPlistFile Payload/POP3SAMPLE.app/Info.plist B4iProject/B4iProject-Info.plist
cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
builtin-infoPlistUtility /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/B4iProject/B4iProject-Info.plist -genpkginfo /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app/Info.plist
CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.o B4iProject/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/7x/k042sg513nj8fzpf3cr7r64m0000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-generated-files.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-own-target-headers.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-all-target-headers.hmap -iquote /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-project-headers.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -F../../Libs -MMD -MT dependencies -MF /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.d --serialize-diagnostics /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.dia -c /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/B4iProject/main.m -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/main.o
CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.o B4iProject/b4i_main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/7x/k042sg513nj8fzpf3cr7r64m0000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-generated-files.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-own-target-headers.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-all-target-headers.hmap -iquote /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/POP3SAMPLE-project-headers.hmap -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources/arm64 -I/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/DerivedSources -F/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -F../../Libs -MMD -MT dependencies -MF /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.d --serialize-diagnostics /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.dia -c /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/B4iProject/b4i_main.m -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_main.o
Ld Payload/POP3SAMPLE.app/POP3SAMPLE normal arm64
cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -L../../Libs -F/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -F../../Libs -filelist /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE.LinkFileList -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lCore -framework Foundation -framework CoreGraphics -framework UIKit -lpop3 -framework AVFoundation -letpan-ios -liDebug -Xlinker -dependency_info -Xlinker /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE_dependency_info.dat -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app/POP3SAMPLE
Undefined symbols for architecture arm64:
"_deflate", referenced from:
_mailstream_low_compress_write in libpop3.a(mailstream_compress.o)
"_deflateEnd", referenced from:
_mailstream_low_compress_open in libpop3.a(mailstream_compress.o)
_mailstream_low_compress_free in libpop3.a(mailstream_compress.o)
"_deflateInit2_", referenced from:
_mailstream_low_compress_open in libpop3.a(mailstream_compress.o)
"_inflate", referenced from:
_mailstream_low_compress_read in libpop3.a(mailstream_compress.o)
"_inflateEnd", referenced from:
_mailstream_low_compress_open in libpop3.a(mailstream_compress.o)
_mailstream_low_compress_free in libpop3.a(mailstream_compress.o)
"_inflateInit2_", referenced from:
_mailstream_low_compress_open in libpop3.a(mailstream_compress.o)
"_sasl_client_init", referenced from:
_mailsasl_ref in libpop3.a(mailsasl.o)
"_sasl_client_new", referenced from:
_mailpop3_auth in libpop3.a(mailpop3.o)
"_sasl_client_start", referenced from:
_mailpop3_auth in libpop3.a(mailpop3.o)
"_sasl_client_step", referenced from:
_mailpop3_auth in libpop3.a(mailpop3.o)
"_sasl_decode64", referenced from:
_mailpop3_auth in libpop3.a(mailpop3.o)
"_sasl_dispose", referenced from:
_mailpop3_free in libpop3.a(mailpop3.o)
_mailpop3_auth in libpop3.a(mailpop3.o)
"_sasl_encode64", referenced from:
_mailpop3_auth in libpop3.a(mailpop3.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error: 2015-08-14 06:59:33.790 xcodebuild[32036:696636] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CLITool+InfoPlist.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **

The following build commands failed:
Ld Payload/POP3SAMPLE.app/POP3SAMPLE normal arm64
(1 failure)
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I trie, my library and the dependency libraries have a arm64 arch, look:

Alberto-Iglesias-MacBook-Pro:B4i-MacServer iglesias$ lipo -info /Users/iglesias/Development/B4i-MacServer/Libs/libpop3.a
Architectures in the fat file: /Users/iglesias/Development/B4i-MacServer/Libs/libpop3.a are: armv7 arm64
Alberto-Iglesias-MacBook-Pro:B4i-MacServer iglesias$

Alberto-Iglesias-MacBook-Pro:B4i-MacServer iglesias$
Alberto-Iglesias-MacBook-Pro:B4i-MacServer iglesias$ lipo -info /Users/iglesias/Development/B4i-MacServer/Libs/libetpan-ios.a
Architectures in the fat file: /Users/iglesias/Development/B4i-MacServer/Libs/libetpan-ios.a are: armv7 arm64
Alberto-Iglesias-MacBook-Pro:B4i-MacServer iglesias$



Question: Can I send to you my library source code to you can check this strange behavior?
 
Top