I have two libraries, I want to call routines in the first library, they then call routines in the second library, but crash because those symbols are undefined. Is it possible to say "load these symbols" from library XX even though I don't want to call them?
testlib1.c:
#include <stdio.h>
void sub2();
void sub1() {
printf("Called sub1\n");
sub2();
}
testlib2.c:
#include <stdio.h>
void sub2() {
printf("Called sub2\n");
}
testit.p6:
use NativeCall;
sub sub1() is native('testlib1') {}
sub sub2() is native('testlib2') {}
sub1();
error:
Cannot locate native library 'libtestlib1.so': ./libtestlib1.so: undefined symbol: sub2
If I call sub2
manually before calling sub1
, it works fine, but I don't want to do that..