Let's assume that I have the following C code:
extern int f_1();
extern int g_1();
extern int f_2();
extern int g_2();
extern int f_3();
extern int g_3();
int main(int argc, char **argv) {
// Using f_1, f_2, f_3 and g_1, g_2, g_3 here:
...
}
And I want to build it by linking with 3 different libraries: l1, l2, l3 -- assuming each of them exports its own f and g functions -- so that:
f_1andg_1will be resolved tofandgrespectively froml1;f_2andg_2will be resolved tofandgrespectively froml2;f_3andg_3will be resolved tofandgrespectively froml3.
Is this possible with gcc and ld:
- Is this possible if
l1,l2,l3are shared libraries (.so)? - Is this possible if
l1,l2,l3are archives (.a)?