I have a problem trying to compile and link my program with "dmalloc".
bin +--dmalloc include +--dmalloc.h lib +--libdmalloc.a +--libdmallocth.a main.c
I have the following directory structure
Now I am trying to compile my program with the following command:
gcc -Iinclude -Llib -ldmalloc -DDMALLOC main.c /tmp/ccSDFmWj.o: In function `main': main.c:(.text+0x29): undefined reference to `dmalloc_malloc' collect2: ld returned 1 exit status
Well, I understand that there is a problem with a link to characters, ld just cannot find a link to dmalloc_malloc. However...
nm lib/libdmalloc.a | grep dmalloc_malloc 0000000000001170 T dmalloc_malloc 0000000000000fe0 t dmalloc_malloc.part.6
I am puzzled ... There is a symbol in this library. Why does ld have problems with this?
Melon source share