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: 3
  • NFCProve.zip
    1.5 KB · Views: 3
Upvote 0

JordiCP

Expert
Licensed User
Longtime User
Are you sure that the files libNFCProve.a and NFCProve.h (case sensitive) are in your Mac's B4iBuildServer/Libs?
 
Upvote 0
Top