Unix questions - problem of linking libraries with GC_MALLOC

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > August 2007 > problem of linking libraries with GC_MALLOC





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author problem of linking libraries with GC_MALLOC
jitender001001@gmail.com

2007-08-08, 7:20 am

hi all
I have a problem of linking static libraries with GC_MALLOC, I
have made my routine smaller to make it simpler.

void
str_check_alloc( char **str, int required)
{
if(required > 0) {
init_reqd = 1;
else
init_reqd = 0;
}

if (init_reqd) {
*str = GC_MALLOC(space2alloc);
(*str)[0] = '\0';
} else
*str = GC_REALLOC(*str, space2alloc);
}
name of main program is "test_toupper.c" which calls this routine
"str_check_alloc" internally.
i m extracting executables in "test_toupper"

gcc -static -g -DINLINE= -I../../../install/include test_toupper.c -
L../../../install/lib -lgc -lsvcr -lm -o test_toupper

.../../../install/lib/libsvcr.a(libsvcr_a-str.o): In function
`str_check_alloc':
/work/anonymous/svc/libsvcr/str.c:47: undefined reference to
`GC_realloc'
/work/anonymous/svc/libsvcr/str.c:44: undefined reference to
`GC_malloc'
collect2: ld returned 1 exit status
gmake: *** [test_toupper] Error 1

I have added "gc.h" library also but still it is showing undifined
reference to GC_MALLOC
what can be the problem.

Regds

Jitender

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com