[Gc] Problem linking libgc.a with Visual Studio

Yasir Majeed leoyasir at gmail.com
Thu Apr 29 01:26:40 PDT 2010


Thanx Ivan for the reply, I tried ur method, when i run the command

lib /out:gc.lib *.obj

Although this command worked but it gaves lots of warning like below
*pcr_interface.obj : warning LNK4221: This object file does not define any
previo
usly undefined public symbols, so it will not be used by any link operation
that
 consumes this library*

So when i compiled my program using Visual C, the errors were same as i
already told u. Can u tell me wot is wrong?
2010/4/29 Ivan Maidanski <ivmai at mail.ru>

>
> Thu, 29 Apr 2010 11:34:01 +0500 Yasir Majeed <leoyasir at gmail.com>:
>
> > Dear all!
> >
> > I want to link library file libgc.a or gc.lib with my Visual C 2010. But
> it is giving link error for the functions like GC_malloc and GC_free. I have
> given gc.lib and libgc.a as the input to the linker. In Visual C you specify
> lib files in project properties->linker->input. I have specified ws2_32.lib
> and iphlpapi.lib correctly. But even i specfied library file for gc but it
> still gives link errors. Can someone tell me how to remove that error?
>
> You should build and link gc.lib with Visual C. E.g.:
>
> cl -MT -DALL_INTERIOR_POINTERS T -DGC_THREADS -I.\include
> -I.\libatomic_ops\src -D_CRT_SECURE_NO_DEPRECATE -c *.c *.cpp
> lib /out:gc.lib *.obj
> cl -MT -DALL_INTERIOR_POINTERS T -DGC_THREADS -I.\include
> -I.\libatomic_ops\src -D_CRT_SECURE_NO_DEPRECATE tests\test.c gc.lib
> user32.lib
>
> (The last command produces test.exe.)
>
> >
> > Regards
> >
> > --
> > Yasir Majeed
> > Ph.D scholar
> > Center of Research in Networks and Telecommunication (CoReNeT)
> > www.corenet.org.pk
> > Mohammad Ali Jinnah University Islamabad, Pakistan
> > +923335935382
>
>


-- 
Yasir Majeed
Ph.D scholar
Center of Research in Networks and Telecommunication (CoReNeT)
www.corenet.org.pk
Mohammad Ali Jinnah University Islamabad, Pakistan
+923335935382
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20100429/6506be76/attachment.htm


More information about the Gc mailing list