Page 1 of 1

Including Ogre into raknet...

Posted: Mon Jan 24, 2005 4:55 am
by c_olin
just for good measure, I thought it would be a good idea to change every printf() in Raknet's code into LogManager::getSingleton().logMessage()

For easier error reading and to unify aeverything.

So, I add:

Code: Select all

#include "Ogre.h"
#include "OgreNoMemoryMacros.h"
Into SocketLayer.h and it compiled fine, and ran fine, but when i exited I would get some strange exeption involving memory.

Any ideas?

Posted: Mon Jan 24, 2005 2:22 pm
by sinbad
LogManager would have to be constructed and a Log created before RakNet did any logging.

I don't think it's really a good idea to replace all of RakNet's logging though, event though printf is a bit of a blunt instrument. You can redirect the output to a file by calling:

Code: Select all

   freopen( "RakNet.log", "w", stdout );
See http://www.cplusplus.com/ref/cstdio/freopen.html .