Closed jacob-pro closed 4 years ago
I can't reproduce this. It works fine on my Linux system.
Floating point values are parsed using atof() ... all I can think of is that your system is set to a locale other than "C". Were there any warnings from the configure script about locale functions being unavailable? Try manually setting the locale to "C" before parsing the file and see if that fixes it.
setlocale(LC_NUMERIC, "C");
The same code is being compiled for Windows & Linux, and using the same copy of libconfig-1.7.2 source. The text file contains values like this (the file is being created by
config_write_file
in the first place):And is then read using
On Windows this works exactly as expected, but on Linux the value in
lat
andlon
is always zero.The issue appears to be somewhere in the process of parsing the text file because my debugger can see the
config_setting_set_float
is being called with a value of 0 during the read file operation.