g++ -lmalloc error

Rupert Wood me@rupey.net
Fri Jun 28 02:05:00 GMT 2002


Long Li wrote:

> g++ -Wall -g -lpthread -lrt -lmalloc -I{$my_file_path}
:
> /usr/bin/ld: can not find -lmalloc
> collect2: ld returned 1 exit status

The problem is that you're asking ld to link against libmalloc.a or
libmalloc.so but it can't find either of these.

Do you have a libmalloc.a or .so? If so, make sure that ld is searching
the path it's in (you can add paths using '-L').

Do you really need libmalloc? The function is probably available in the
C library unless you've got special requirements. Check your OS C
library documentation.

Rup.



More information about the Gcc-help mailing list