rendered paste body$ cat stupid.h
int func_a(void);
int func_b(void);
$ cat stupid.c
#include "stupid.h"
int func_a(void)
{
func_b();
return 0;
}
$ cat mongo.c
#include "stupid.h"
int main(int argc, char **argv)
{
func_a();
return 0;
}
$ gcc -Wall -pedantic -g -fPIC -c stupid.c
$ gcc -shared -pedantic -Wall -g -fPIC -o libstupid.so stupid.o
$ gcc -Wall -pedantic -g -fPIC -o mongo mongo.c -L. -lstupid -Wl,-rpath,`pwd`
./libstupid.so: undefined reference to `func_b'
collect2: ld returned 1 exit status