Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "Wayne K. Werner" Newsgroups: scea.yaroze.programming.codewarrior Subject: Getting up and going with C++ Date: 10 Jul 1997 02:16:09 GMT Organization: SCEA Net Yaroze News Lines: 50 Message-ID: <01bc8cd7$41d70880$ccbf43ce@wkwerner> NNTP-Posting-Host: port104.con2.com X-Newsreader: Microsoft Internet News 4.70.1155 Just a little more in the saga of getting C++ going. size_t, defined as unsigned int in sys\types.h is incompatable with the compilers idea of what should be passed as operator new's first parameter. I got an error every time I tried to compile. Thanks to Nick Porcino's email of the other day I was able to see what he did. He defined the size as unsigned long. I tried this, and it worked. Thanks, Nick. I don't know how long I would have messed around with this before I figured that out. This however, needs to be addressed, in as far as size_t is supposed to work as the type passed to the memory allocation functions and as the type returned by sizeof, etc. BTW, a small header containing the following is now working for me: inline void *operator new (unsigned long sz){ return malloc(sz); } inline void operator delete(void *p){ if(NULL != p) free(p); } Will the next version of the compiler support redefining operators new[] and delete[]? The current version chokes when I try to do this. These will be needed to truely emulate the default behavior of the C++ compiler. (What am I saying... the next version will allow us to throw away the home rolled stuff!) I have some questions. I still have the MIPS Support directory available to me. It includes a header and lib directory. Some of these headers appear to conflict with the headers in Playstation Support. The C++ library is in the lib directory. Can I somehow use this existing library and headers? Can they be integrated into the Playstation support in some way? Do I need to go here instead of to ps support? Will they eliminate the need for rolling my own global operators new and delete? In other words, can I get some guidelines on using the MIPS Support directory? Meanwhile, I will continue to mess around on my own and see if I can't shed some light on these issues myself. The support from all you MW guys out there has been mind boggling. I know that I am one of those who has complained that the CW product is not all I want, but the speed with which you guys answer questions and give advice, and the obvious dedication to giving me and the rest of the NY members what we want, is just great! Thanks! Not that the NY support people (Mario, take a bow) don't deserve a great deal of credit also. Between all of the official support, and the dialog of all the informed users, this has been a very rewarding experience. I'm really glad I joined the NY community! Thanks all! Wayne