[Gc] RE: Building NT_STATIC_THREADS_MAKEFILE

Greg Terry gterry at EXANSOFTWARE.com
Fri Mar 30 11:57:04 PST 2007


Hello

 

I'm new to the Boehm Garbage Collector and this list, and would greatly
appreciate additional information on successfully building gc.lib for
MSVC++ 2003.

Using the makefile suggestion from the subject thread, I have built the
following test application:

 

#include "gc_cpp.h"

#include <windows.h>

 

 

int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev, LPSTR cmd, int
cmdShow ) 

{

      char *str = new (UseGC) char[255];

      return str ? 0 : 1;

} 

 

 

This will not link, presenting me with the following unresolved
externals:

 

Linking...

test.obj : error LNK2019: unresolved external symbol
__imp__GC_malloc_uncollectable referenced in function "void * __cdecl
operator new(unsigned int,enum GCPlacement,void (__cdecl*)(void *,void
*),void *)" (??2 at YAPAXIW4GCPlacement@@P6AXPAX1 at Z1@Z)

test.obj : error LNK2019: unresolved external symbol
__imp__GC_malloc_atomic referenced in function "void * __cdecl operator
new(unsigned int,enum GCPlacement,void (__cdecl*)(void *,void *),void
*)" (??2 at YAPAXIW4GCPlacement@@P6AXPAX1 at Z1@Z)

test.obj : error LNK2019: unresolved external symbol
__imp__GC_register_finalizer_ignore_self referenced in function "void *
__cdecl operator new(unsigned int,enum GCPlacement,void (__cdecl*)(void
*,void *),void *)" (??2 at YAPAXIW4GCPlacement@@P6AXPAX1 at Z1@Z)

test.obj : error LNK2019: unresolved external symbol __imp__GC_malloc
referenced in function "void * __cdecl operator new(unsigned int,enum
GCPlacement,void (__cdecl*)(void *,void *),void *)"
(??2 at YAPAXIW4GCPlacement@@P6AXPAX1 at Z1@Z)

../../test.exe : fatal error LNK1120: 4 unresolved externals

 

 

If I modify the following line

str = new (UseGC) char[255] 

to be 

str = new char[255] 

I can link but of course the MS implementation of "new" is used.

 

Any suggestions, or examples would be greatly appreciated.

TIA,

Greg Terry

 

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20070330/d881568a/attachment.htm


More information about the Gc mailing list