KenzieMac130 / ogre-procedural

Automatically exported from code.google.com/p/ogre-procedural
0 stars 0 forks source link

Compile error with unicode build #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
reported by saft on the forum :

I have one suggestion for your code.
In the file "ProceduralUtils.h" i replaced the code.

CODE: SELECT ALL
static void log(const Ogre::String& st)
{
   Ogre::LogManager::getSingleton().logMessage("[PROCEDURAL] " + st);
   #if (PROCEDURAL_PLATFORM == PROCEDURAL_PLATFORM_WIN32)      
      OutputDebugString( (st + "\n").c_str() );
   #endif
}

with the following lines:

CODE: SELECT ALL
static void log(const Ogre::String& st)
{
   Ogre::LogManager::getSingleton().logMessage("[PROCEDURAL] " + st);
   #if (PROCEDURAL_PLATFORM == PROCEDURAL_PLATFORM_WIN32)      
      #ifdef UNICODE
         std::basic_ostringstream<TCHAR> buf;
         buf << st.c_str();
         std::wstring wst = buf.str();               
         OutputDebugString( wst.c_str() );
      #else
         OutputDebugString( (st + "\n").c_str() );
      #endif   
   #endif
}

If you do that, you are able to compile in the library in Multibyte and Unicode 
chracter-sets.
Otherwise i got a compile-error. The code is tested and should work.

Greetings
Saft

Original issue reported on code.google.com by michael.broutin@gmail.com on 10 May 2012 at 7:50

GoogleCodeExporter commented 8 years ago

Original comment by michael.broutin@gmail.com on 10 May 2012 at 7:50

GoogleCodeExporter commented 8 years ago

Original comment by michael.broutin@gmail.com on 12 May 2012 at 6:52

GoogleCodeExporter commented 8 years ago

Original comment by michael.broutin@gmail.com on 27 May 2012 at 8:22