problem of linking libraries with GC_MALLOC
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > problem of linking libraries with GC_MALLOC




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    problem of linking libraries with GC_MALLOC  
jitender001001@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-08-07 12:20 PM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:10 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register