67 C:\Documents and Settings\Oliver\Desktop\C++ Work\Irrlicht Game Engine\irrlicht-0.9\examples\Demo\CDemo.cpp invalid conversion from `int' to `const wchar_t*'
Just trying to compile the demo in the tutorials so i can try and edit it however it wont compile due to the above error and i cant find anything which corrects it, it it a commen mistake which can be repared easily or what?
Siolis
PS: Im useing Dev-C++ 4.9.9.2 and all the other examples work fine.
err anyone reconize this: invalid convershion in CDemo.cpp
Re: err anyone reconize this: invalid convershion in CDemo.c
If you look at the code it's the followingSiolis wrote:67 C:\Documents and Settings\Oliver\Desktop\C++ Work\Irrlicht Game Engine\irrlicht-0.9\examples\Demo\CDemo.cpp invalid conversion from `int' to `const wchar_t*'
Code: Select all
swprintf(tmp, 255, L"%s fps:%d", driver->getName(), driver->getFPS());
K ive got two comments to make:
Firstly ive found the function inside of IVideoDriver.h and:
virtual const wchar_t* getName() = 0;
to boot, i dont see how:
swprintf(tmp, 255, L"%s fps:%d", driver->getName(), driver->getFPS());
tries to send it an int, plus the help file says this function returns a pointer so...can anyone send me a working vershion of this dam engine or explain wtf is going on hear?
Im not an experienced programmer, im a designer with programing ability trying to build his own game so try to keep it simple please.
Siolis
Firstly ive found the function inside of IVideoDriver.h and:
virtual const wchar_t* getName() = 0;
to boot, i dont see how:
swprintf(tmp, 255, L"%s fps:%d", driver->getName(), driver->getFPS());
tries to send it an int, plus the help file says this function returns a pointer so...can anyone send me a working vershion of this dam engine or explain wtf is going on hear?
Im not an experienced programmer, im a designer with programing ability trying to build his own game so try to keep it simple please.
Siolis
I'm not sure if you meant this, but swprintf does not return a string, it returns the numbers of wide characters written to the string. So if you want to access the string afterwards you have to use tmp.Siolis wrote: swprintf(tmp, 255, L"%s fps:%d", driver->getName(), driver->getFPS());
tries to send it an int, plus the help file says this function returns a pointer so...can anyone send me a working vershion of this dam engine or explain wtf is going on hear?
change the swprintf line to _snwprintf. It has to do with some typedefs Irrlicht makes, but this fixes it for MinGW
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars
[Linker error] undefined reference to `_imp__AdrOpenSound@12'
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
ld returned 1 exit status
C:\Documents and Settings\Oliver\Desktop\C++ Work\Irrlicht Game Engine\irrlicht-0.9\examples\Demo\Makefile.win [Build Error] [Demo.exe] Error 1
I think im gonna cry...
Siolis
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
[Linker error] undefined reference to `_imp__AdrOpenSampleSource@8'
ld returned 1 exit status
C:\Documents and Settings\Oliver\Desktop\C++ Work\Irrlicht Game Engine\irrlicht-0.9\examples\Demo\Makefile.win [Build Error] [Demo.exe] Error 1
I think im gonna cry...
Siolis
So MingW does not support the usual Linux interface? It seems to be a wide-char enhanced BSD function. Linux does not provide an swprintf without limiting the maximal output length, thus no need to change to a different function. Does anyone know which OS this routine comes from?Electron wrote:change the swprintf line to _snwprintf. It has to do with some typedefs Irrlicht makes, but this fixes it for MinGW
But it shouldn't be a problem with typedefs in Irrlicht, probably missing ifdefs though.
I really don't know what MinGW is doing. According to my std library reference, what Irrlicht is doing is in accordance with the swprintf function in cwchar. I just know that changing it to _snwprintf works, at least with an Irrlicht app
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
Crucible of Stars
Crucible of Stars