[Gc] VC++ build files

DrPizza DrPizza at quiscalusmexicanus.org
Mon Jun 30 15:23:01 PDT 2008


I have a question (down below) and some minor modifications and project files that might be nice to share.

It may be that I'm a total nub, or it may be that Makefiles are horrid and nmake even worse, but I've never really cared for building at the command-line.  VC++ is a much more pleasing environment to work in when doing my Windows development.  Anyway, the makefile versions have been annoying me for some time because I'm never sure which CRT they're using; there also seems to be something strange with MS's makefile header thing that seems to make non-debug builds be debug builds when building x64 binaries or something.


I want to put together VC++ 2008 project files to build the Cartesian product of { win32, win64 } × { debug, release } × { static, DLL }, all multithreaded (as VC++ nowadays only has a multithreaded runtime, it seems appropriate).

I'm currently using the following #defines (in addition to VC++'s defaults, so _WIN32, _DEBUG/NDEBUG, and the various processor type #defines etc.):

All builds:    GC_THREADS,
Debug builds:  GC_DEBUG
DLL builds:    GC_DLL
Static builds: GC_NOT_DLL,

My question is, are these reasonable?  The project files in CVS also define SAVE_CALL_COUNT=8.  If I define that then I get crashes inside GC_save_callers; the memcpy (BCOPY) is passed bad parameters and crashes.  Don't know why.

I also have a .lib for C++ programs to override global operator new/global operator delete (this can only be done with a .obj or a static .lib; it can't use a DLL, or so says MS).

I'm building all the tests except the trace_test (which won't link; I think the immediate problem is that GC_generate_random_backtrace needs to be marked with GC_API, but that's not enough to make it work anyway).  Each test is constructed with each possible GC library (i.e. 8 versions of each are produced).  I have made some changes to the thread_leak_test so that it can use Win32 threads as well as pthreads.  I think the tests all run successfully.

The project structure I'm using is quite different from that of the projects that are in CVS.  Instead of a project each for static/DLL I have one project with multiple configurations.  I find this makes organization a little easier.

More information about the Gc mailing list