locale/setlocale etc won't compile

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

locale/setlocale etc won't compile

Post by freetimecoder »

Hi,

this is Irrlicht related in a roundabout way, because the xml writer is affected by it.
I want to write vector3d attributes to a file but it turns out "123,0000, 32,00000, 14,0000" instead of "123.0000, 32.00000, 14.0000". I searched for a solution and found out about the locale settings. But when I try to use std::locale::global or setlocale or anyting like that it always tells me "error: expected constructor, destructor, or type conversion before '(' token" What should I do? I tried including locale.h, locale, clocale etc. but nothing worked.
I am using Code::Blocks with MinGW on a Windows 7 64bit machine and Irrlicht 1.7.2.

Code: Select all

 
setlocale(LC_ALL,"C");
 

Code: Select all

 
std::locale::global(std::locale("C"));
 

greetings
FTC
Post Reply