All pastes #509388 Raw Edit

Something

public text v1 · immutable
·published 2007-05-25 13:02 UTC
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