B4J Question How does B4X call C language function code?

daiweisc

Member
How does B4X call C language function code?
C language Structure is created by unpacking the ANSI C release tar / zip files.
For example the codes in ANSI C:
B4X:
#include "sofa.h"
#include "sofam.h"
int iauApco13(double utc1, double utc2, double dut1, double elong, double phi, double hm, double xp, double yp, double phpa, double tc, double rh, double wl, iauASTROM *astrom, double *eo)
 
Last edited:

Quandalle

Member
Licensed User
The easiest way is to compile the C code in the form of an external executable program (Linux or Windows) with a standard C compiler.
B4X can then be used to launch this external program and wait for it to finish executing (cf jShell ).
Parameters can be passed by file or command line.
Results can be passed by file or on the console stream.
 
Upvote 0
Top