Comments (7)
Windows platform? Maybe Windows does not have timegm.
According to http://stackoverflow.com/questions/16647819/timegm-cross-platform, _mkgmtime will work.
Try
#define timegm _mkgmtime
from tinytoml.
Works fine with the define directive, thanks!
from tinytoml.
Sorry that I reopen but that gives me an new error, I don't know if this is based on the compiler (cause of linking) or on the header. I wrote simply this, to check if my files are valid:
/* at least lets check if the TOML based files are all valid */
std::ifstream r_ifs(_r_file.toStdString().c_str());
toml::Parser r_parser(r_ifs);
toml::Value r_val = r_parser.parse();
if (r_val.valid())
{
/* everything is fine */
printf("root file is valid TOML\n");
}
This gives me
debug/project.o: In function `ZN4toml6Parser9parseTimeERKSsPNS_5ValueE':
c:\arden/src/core/../../externals/tinytoml/toml.h:830: undefined reference to `_mkgmtime'
from tinytoml.
Since it's a link error, the code itself should be ok.
You're using mingw 32bit version? I found this one.
http://sourceforge.net/p/mingw-w64/bugs/473/
If this is true, It's mingw bug, I believe. You can follow this article to fix.
Or, try another approach.
Try to add timegm which is also mentioned in
http://stackoverflow.com/questions/16647819/timegm-cross-platform
by yourself? I didn't check it, but the writer says it works on Windows. I'm not sure it also works on mingw environment.
time_t timegm(struct tm * a_tm)
{
time_t ltime = mktime(a_tm);
struct tm tm_val;
gmtime_s(&tm_val, <ime);
int offset = (tm_val.tm_hour - a_tm->tm_hour);
if (offset > 12)
{
offset = 24 - offset;
}
time_t utc = mktime(a_tm) - offset * 3600;
return utc;
}
from tinytoml.
Yep using MinGW 32-bit but the version which was installed when installing Qt, so rebuilding would not work.
from tinytoml.
Then, try to define timegm() by yourself. Doesn't it work?
from tinytoml.
No update, closing.
from tinytoml.
Related Issues (20)
- toml::parse() fails if UTF-8 BOM is present. HOT 1
- unordered_map instead of map for tables? HOT 6
- Support for ints in hex/binary format? HOT 4
- gmtime_r fails with MinGW GCC version 4.8.0 HOT 5
- Use sscanf_s for msvc? HOT 1
- Signed integer overflow on libstdc++ HOT 4
- Check state of input stream before parsing HOT 1
- support compilation with exception disabled HOT 3
- Suggestion: rename include/toml to include/tinytoml HOT 2
- TOML 5.0 HOT 1
- Suggestion: Add VERSION MACRO.
- Cut a tagged release HOT 1
- FYI: Made a Conan recipe for tinytoml HOT 1
- Can't compile with nvcc 9.0.176 or 10.0.130 HOT 1
- Make "typeToString()" public? HOT 2
- Macro for adding custom types to Value::as<T>()
- Do you have plans to support toml 0.5.0 or 1.00?
- Type type() const { return type_; } Seg fault on Beagle Bone black, ARM target HOT 1
- stack-overflow at "parseFile" HOT 1
- ABRT on __cxxabiv1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinytoml.