My FB libary has the following code:
Code: Select all
Function Duplicate(v As Short) As Short
Return 2 * v
End Function
Code: Select all
fbc -lib dupli.bas
Now I make a C program called a.c like this:
Code: Select all
extern short DUPLICATE(short v);
#include "stdio.h"
void main() {
printf("%d", DUPLICATE(5));
}
Code: Select all
gcc -L. -l:libdupli.a a.c
Code: Select all
/usr/bin/ld: /tmp/ccpSo8AN.o: in function `main':
a.c:(.text+0xe): undefined reference to `DUPLICATE'
collect2: error: ld returned 1 exit status