Consider the program:
#include <gc/gc.h>
int main() {
void* p = GC_MALLOC(15);
}
Under Ubuntu 10.04 LTS this compiles (gcc -lgc test.c
). Under 12.04 LTS:
/tmp/cc7GcTfU.o: In function `main':
main.c:(.text+0xe): undefined reference to `GC_malloc'
collect2: ld returned 1 exit status
It looks like between 10.04 and 12.04 they've changed the library not to compile in malloc replacements. Or that's what I think this description of the libgc1c2
package says:
[...] However, it does not work as a drop-in malloc(3) replacement.
Is there a simple way to get around this? (Say, something simpler than recompiling libgc manually...)