Dunno, he mostly uses VC++
Okay, heres how I modified the swprintf function to get a formated string for output without invalid conversion errors.
char temp[255];
wsprintf(temp, TEXT("%s fps:%d polys:%d"), driver->getName(),
driver->getFPS(), driver>getPrimitiveCountDrawn());
for (int i=0; i<256;i++)
{
tmp=(wchar_t)temp;
}
for some reason only the first letter of the rendering type seems to come out, but the fps and triangle counts come out fine
Problem with compiling Techdemo with DevCpp
The cause is rather convoluted. The solution is indeed simple.
The cause:
Irrlicht.h redefines swprintf as _snwprintf
#include <wchar.h>
#ifdef _WIN32
//! Define for swprintf because this method does not match the ISO C standard
//! on Win32 platforms, but it does on all other ones.
#define swprintf _snwprintf
#endif // WIN32
CDemo.h then includes <audiere.h>
<audiere.h> includes <string>
<string> includes <iosfwd>
<iosfwd> includes <fpos.h>
<fpos.h> includes <cwchar>
swprintf is undefined in <cwchar>
redefined as
#if _GLIBCPP_USE_WCHAR_T
namespace std
{
using ::swprintf;
}
Thus losing its definition as _snwprintf, reverting back to the original swprintf.
The solution is indeed to use _snwprintf in place of swprintf.
The cause:
Irrlicht.h redefines swprintf as _snwprintf
#include <wchar.h>
#ifdef _WIN32
//! Define for swprintf because this method does not match the ISO C standard
//! on Win32 platforms, but it does on all other ones.
#define swprintf _snwprintf
#endif // WIN32
CDemo.h then includes <audiere.h>
<audiere.h> includes <string>
<string> includes <iosfwd>
<iosfwd> includes <fpos.h>
<fpos.h> includes <cwchar>
swprintf is undefined in <cwchar>
redefined as
#if _GLIBCPP_USE_WCHAR_T
namespace std
{
using ::swprintf;
}
Thus losing its definition as _snwprintf, reverting back to the original swprintf.
The solution is indeed to use _snwprintf in place of swprintf.