Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
502 stars 194 forks source link

Can't compile in GnuWin32 + MinGW 32 #130

Closed mbollini closed 3 years ago

mbollini commented 3 years ago

Hi, I followed the instructions but the library fails to compile. I get these errors:

g++ -c -I AdsLib/ -I tools/ -std=c++11 -pedantic -Wall -Wextra -D_GNU_SOURCE  AdsLib/Log.cpp -o obj/Log.o
AdsLib/Log.cpp: In static member function 'static void Logger::Log(size_t, const string&)':
AdsLib/Log.cpp:34:9: error: 'localtime_s' was not declared in this scope; did you mean 'localtime'?
   34 |         localtime_s(&temp, TIME_T); \
      |         ^~~~~~~~~~~
AdsLib/Log.cpp:60:9: note: in expansion of macro 'TIME_T_TO_STRING'
   60 |         TIME_T_TO_STRING(dateTime, &tt);
      |         ^~~~~~~~~~~~~~~~
pbruenn commented 3 years ago

localtime_s() was standardized with C11/C++11, which is this libraries minimum requirement. https://en.cppreference.com/w/c/chrono/localtime