[Gc] Building NT_STATIC_THREADS_MAKEFILE

Christophe Meessen meessen at cppm.in2p3.fr
Sat Mar 24 06:59:20 PST 2007


Hello,

I finally managed to get a working static gc.lib (gc6.8) with VC++2003.

I used NT_STATIC_THREADS_MAKEFILE but a small change to the file was
required. The 'cvars' has to be changed into 'cvarsmt' which are the
options to build a static multithreaded application.
-----
.c.obj:
	$(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -DSILENT
-DALL_INTERIOR_POINTERS -D__STDC__ -DGC_NOT_DLL -DGC_WIN32_THREADS $*.c
/Fo$*.obj

.cpp.obj:
	$(cc) $(cdebug) $(cflags) $(cvarsmt) -Iinclude -DSILENT
-DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP -DGC_WIN32_THREADS /Fo$*.obj
-----

The command line used to compile was then
'nmake /f NT_STATIC_THREADS_MAKEFILE gc.lib'

which builds the static multihtreaded debug vesion of the library.
To build a non debug version one should have to add 'nodebug=1' before
gc.lib in the command line.

I then linked with test_cpp.cpp also compiled in debug mode and ran it.
This time it succeeded.

Running in debug mode provides memory checking ensuring nothing wrong is
done to memory (double delete, block header corruption, delete 'fake'
pointers).

Just hoping this info can be helpfull to other users.


More information about the Gc mailing list