iOS Question Help for external library.

fabio.mevoli

Member
Licensed User
I have B4i version 8.90 and Hosted Builder.
I compiled a static library named CoreNFCLib with Xcode 16, which includes the two files CoreNFCLib.m and CoreNFCLib.h.
This produced the file CoreNFCLib.a.
I copied both CoreNFCLib.a and CoreNFCLib.h into the folder \Documents\B4i\Libraries.
I used B4iH2XML to create an XML file in the same folder.
Finally, I added the library path in B4i.
The library appears in the B4i Library tab.
Initial build: error — cannot find CoreNFCLib.h.
I moved a copy of the file to C:\Program Files\Anywhere Software\B4i\Project (strange, but now it finds the file).
Second build: error — cannot find the library, even though I added the path.
I added the #AdditionalLib: CoreNFCLib.a directive, but it didn’t help.
Is there a guide explaining how to add an external library compiled with Xcode to a B4i project?
I have been working on this issue for two weeks.
 

fabio.mevoli

Member
Licensed User
In order not to disturb, I installed the local build server, and it works for compiling apps that use B4i's internal libraries. If I use external libraries I created myself (.a, .h, .xml files), which folders should I copy them to?
I added the libraries to C:\Program Files\Anywhere Software\B4i\Libraries on my PC and to \B4iBuildServer\Libs on my Mac.
I also added #AdditionalLib: libCoreNFCLib.a to B4Xmainpage.
In this case, I receive the error message:
ld: library 'libCoreNFCLib.a' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error: ** BUILD FAILED **
 
Upvote 0

fabio.mevoli

Member
Licensed User
I compiled the library with xcode 16
the library is in C:\Users\fabio.mevoli\Documents\B4i\Libraries also in \B4iBuildServer\Libs on my Mac.
To test the building I add a declaration in Sub Class_Globals and a sub:

Sub Class_Globals
Private Root As B4XView
Private xui As XUI
' Variabili per NFC
Dim nfc As NFCProve
End Sub

Private Sub Button1_Click
' Inizializza la libreria: "NFC" è il nome dell’evento
nfc.Initialize("NFC")
' Avvia la sessione NFC
nfc.StartSession
End Sub

I receive the same message from the Builder server on my Mac:

NfcStTest.app/NfcStTest
ld: library 'libNFCProve.a' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 

Attachments

  • NFCProve.xml
    1,008 bytes · Views: 7
  • NFCProve.zip
    1.5 KB · Views: 6
Upvote 0

fabio.mevoli

Member
Licensed User
Yes I'm sure I copy the library from my pc and put them in usb key and I put them in a builder server directory Libs so same files . I have dubit on where the Buider server folder is created. I put the bulder server folder in the documents folder of the MAC, Is it the right place?
 
Upvote 0

fabio.mevoli

Member
Licensed User

B4i Build Server​

Build server is running.
Version: 9.2
Server time: 10:38:26

Mac SSL Key​

Invalid key!!!
SSL port: 51042

h files​

  • iCPP: 1.00
  • iFirebaseNotifications: 3.00
  • iCustomDialog: 1.00
  • iAdMob: 4.10
  • iXmlBuilder: 1.00
  • iEventKit: 1.10
  • iReleaseLogger: 1.00
  • iSideMenu: 1.01
  • iSVG: 1.20
  • iTableView: 1.21
  • iUI8: 1.63
  • iStringUtils: 1.02
  • iSQL: 1.50
  • NFCProve: 1.0
  • iArchiver: 1.20
  • iXUI: 2.31
  • xCustomListView
  • iGameView: 1.05
  • iSpeechRecognition: 1.00
  • iHUD: 1.00
  • iNFC: 1.10
  • iLeadbolt: 2.00
  • iRandomAccessFile: 1.72
  • iGameCenter: 1.01
  • iHttp: 1.02
  • iStore: 1.22
  • iNet: 1.81
  • iGoogleMaps: 1.50
  • iXUI2D: 1.02
  • iCore: 8.90
  • iFacebook: 2.10
  • iBLE: 2.00
  • iBarcode: 1.22
  • iWebSocket: 1.11
  • iCallSubUtils
  • iXmlSax: 1.10
  • iDebug2: 1.60
  • iFirebaseAuth: 3.00
  • iMedia: 1.24
  • iFirebaseAnalytics: 3.00
  • iDesigner: 1.20
  • iPing: 1.00
  • iDateUtils
  • iFirebaseStorage: 3.00
  • iTabStrip: 1.00
  • iCustomListView
  • iRSA: 1.0
  • iAd: 1.00
  • iEncryption: 1.03
  • iContacts: 1.00
  • iDebug: 1.60
  • iNetwork: 1.33
  • iPhone: 2.01
  • iFLAnimatedImage
  • iLocation: 1.20
  • iBitmapCreator
  • iMQTT: 1.11
  • iAnalytics: 1.0
  • iUI9: 1.12
  • iJSON: 1.21
  • iDropboxSync: 1.00
  • CoreNFCLib
  • iHttpUtils2

a files​

  • libiBLE, size=228,216, modified=09/25/2025 15:28:24
  • libiDropboxSync, size=80,960, modified=09/25/2025 15:28:26
  • libiHttpUtils2, size=342,992, modified=09/25/2025 15:28:28
  • libiHttp, size=118,960, modified=09/25/2025 15:28:28
  • libiWebSocket, size=360,480, modified=09/25/2025 15:28:32
  • libiXUI2D, size=8,548,840, modified=09/25/2025 15:28:32
  • libiCustomDialog, size=2,720,512, modified=09/25/2025 15:28:24
  • libiNetwork, size=259,584, modified=09/25/2025 15:28:28
  • libxCustomListView, size=500,048, modified=09/25/2025 15:28:34
  • libiLocation, size=125,184, modified=09/25/2025 15:28:28
  • libiStore, size=45,296, modified=09/25/2025 15:28:30
  • libiNFC, size=82,696, modified=09/25/2025 15:28:30
  • libiHUD, size=188,064, modified=09/25/2025 15:28:28
  • libiRandomAccessFile, size=399,912, modified=09/25/2025 15:28:30
  • libiNet, size=526,744, modified=09/25/2025 15:28:28
  • libiBitmapCreator, size=1,511,296, modified=09/25/2025 15:28:24
  • libiSpeechRecognition, size=168,816, modified=09/25/2025 15:28:30
  • libiDebug2, size=649,896, modified=09/25/2025 15:28:24
  • libiXmlSax, size=62,976, modified=09/25/2025 15:28:32
  • libiSQL, size=397,456, modified=09/25/2025 15:28:30
  • libiEncryption, size=65,824, modified=09/25/2025 15:28:26
  • libiUI8, size=383,544, modified=09/25/2025 15:28:32
  • libiXUI, size=598,536, modified=09/25/2025 15:28:32
  • libiContacts, size=142,816, modified=09/25/2025 15:28:24
  • libiTableView, size=194,152, modified=09/25/2025 15:28:30
  • libiDesigner, size=555,312, modified=09/25/2025 15:28:26
  • libiCallSubUtils, size=126,952, modified=09/25/2025 15:28:24
  • libiCPP, size=7,480, modified=09/25/2025 15:28:24
  • libCore, size=2,336,168, modified=09/25/2025 15:28:22
  • libiSVG, size=83,312, modified=09/25/2025 15:28:30
  • libiTabStrip, size=1,360,128, modified=09/25/2025 15:28:32
  • libiAdMob, size=322,376, modified=09/25/2025 15:28:22
  • libiCustomListView, size=316,424, modified=09/25/2025 15:28:24
  • libiMQTT, size=1,697,472, modified=09/25/2025 15:28:28
  • libiFacebook, size=91,120, modified=09/25/2025 15:28:26
  • libCoreNFCLib, size=33,080, modified=09/25/2025 08:09:12
  • libGTM, size=1,419,736, modified=09/25/2025 15:28:22
  • libiUI9, size=181,552, modified=09/25/2025 15:28:32
  • libiAd, size=39,072, modified=09/25/2025 15:28:22
  • libSSZipArchive, size=562,848, modified=09/25/2025 15:28:34
  • libNFCProve, size=3,824, modified=09/30/2025 14:17:24
  • libiFirebaseAuth, size=126,840, modified=09/25/2025 15:28:26
  • libiGoogleMaps, size=108,944, modified=09/25/2025 15:28:28
  • libAdapterInMobi, size=1,125,360, modified=09/25/2025 15:28:22
  • libiAnalytics, size=39,392, modified=09/25/2025 15:28:24
  • libiLeadbolt, size=21,440, modified=09/25/2025 15:28:28
  • libiGameCenter, size=158,080, modified=09/25/2025 15:28:26
  • libiFirebaseStorage, size=107,240, modified=09/25/2025 15:28:26
  • libiJson, size=66,560, modified=09/25/2025 15:28:28
  • libiStringUtils, size=33,752, modified=09/25/2025 15:28:30
  • libiBarcode, size=236,600, modified=09/25/2025 15:28:24
  • libiPhone, size=213,912, modified=09/25/2025 15:28:30
  • libiRSA, size=145,648, modified=09/25/2025 15:28:30
  • libiPing, size=327,776, modified=09/25/2025 15:28:30
  • libiGameView, size=4,018,288, modified=09/25/2025 15:28:26
  • libiFirebaseNotifications, size=42,848, modified=09/25/2025 15:28:26
  • libiArchiver, size=463,088, modified=09/25/2025 15:28:24
  • libiFLAnimatedImage, size=423,160, modified=09/25/2025 15:28:26
  • libiDateUtils, size=257,440, modified=09/25/2025 15:28:24
  • libiXmlBuilder, size=151,384, modified=09/25/2025 15:28:32
  • libiSideMenu, size=505,920, modified=09/25/2025 15:28:30
  • libiMedia, size=251,840, modified=09/25/2025 15:28:28
  • libiReleaseLogger, size=50,136, modified=09/25/2025 15:28:30
  • libiEventKit, size=244,360, modified=09/25/2025 15:28:26
  • libiFirebaseAnalytics, size=31,272, modified=09/25/2025 15:28:26
 
Upvote 0

JordiCP

Expert
Licensed User
Longtime User
Never tried the documents folder

In my Mac I'm using /Applications/B4iBuildServer
The 'Libs' folder should always be under it, i.e., /Applications/B4iBuildServer/Libs, and the files you need should be under that Libs folder

Just in case, is it possible that you have more than one B4iBuildServer folder in your Mac and executing the Build Server in one of them while the libraries have been added to the other?
 
Upvote 0

fabio.mevoli

Member
Licensed User
I tried to move the Build server using /Applications/B4iBuildServer without success.

Ld /Applications/B4iBuildServer/UploadedProjects/<user id>/Payload/NfcStTest.app/NfcStTest normal (in target 'B4iProject' from project 'B4iProject')
cd /Applications/B4iBuildServer/UploadedProjects/<user id>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios13.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk -O0 -L/Applications/B4iBuildServer/UploadedProjects/<user id>/build/EagerLinkingTBDs/Release-iphoneos -L/Applications/B4iBuildServer/UploadedProjects/<user id>/Payload -L../../Libs -F/Applications/B4iBuildServer/UploadedProjects/<user id>/build/EagerLinkingTBDs/Release-iphoneos -F/Applications/B4iBuildServer/UploadedProjects/<user id>/Payload -F../../Libs -filelist /Applications/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/NfcStTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -object_path_lto -Xlinker /Applications/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/NfcStTest_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -lCore -framework Foundation -framework CoreGraphics -framework UIKit -liNetwork -liPhone -lNFCProve -framework AVFoundation -framework MessageUI -framework CoreMotion -liXUI -weak_framework CoreNFC -llibNFCProve.a -liDebug2 -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Applications/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/NfcStTest_dependency_info.dat -o /Applications/B4iBuildServer/UploadedProjects/<user id>/Payload/NfcStTest.app/NfcStTest
ld: library 'libNFCProve.a' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Error: ** BUILD FAILED **


The following build commands failed:
Ld /Applications/B4iBuildServer/UploadedProjects/<user id>/Payload/NfcStTest.app/NfcStTest normal (in target 'B4iProject' from project 'B4iProject')
(1 failure)
 
Upvote 0
Top