Closed mbollini closed 1 year ago
Unfortunately yes I have an idea. At first I had "cpp_std=c++11" as a default option in meson.build until clang on windows with Visual C++ headers complained because Microsoft headers already require c++14. So I decided to let the compiler use it's own default as I only had clang on macOS and gcc5 on linux for win32 cross build require explicit cpp_std=c++11, which you can see in my gitlab yaml: https://github.com/Beckhoff/ADS/blob/0e0f73f709841c8ee3a0c1ff20ebb46165662d9f/.gitlab-ci.yml#L60
So try:
meson build -Dcpp_std=c++11
or
meson build -Dcpp_std=c++14
or add it to the meson.build file, which i might do if your compiler combination seems more widespread than mine:
https://github.com/Beckhoff/ADS/blob/0e0f73f709841c8ee3a0c1ff20ebb46165662d9f/meson.build#L3-L5
If you are a meson starter like me, make sure to either delete your build dir before you try to change the cpp_std option or use
meson setup --wipe build -Dcpp_std=c++11
I started with a clean git, issued 'meson build -Dcpp_std=c++11' but ninja fails to build. See attached log.
Did the old Makefile worked better for you? Sorry I have no other idea than to blame the compiler :-( https://stackoverflow.com/questions/34847804/stdthread-works-in-cygwin-but-not-in-mingw
Hi, I did a clean git.
Meson works fine. This is its output:
Ninja build fails because of a lot of errors.
I report just the very first here:
C:\Users\Maurizio\Documents\GitHub\ADS>ninja -C build ninja: Entering directory
build' [4/17] Compiling C++ object libAdsLib.a.p/AdsLib_Log.cpp.obj FAILED: libAdsLib.a.p/AdsLib_Log.cpp.obj "c++" "-IlibAdsLib.a.p" "-I." "-I.." "-I..\AdsLib" "-I..\tools" "-fdiagnostics-color=always" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Wextra" "-Wpedantic" "-g" -MD -MQ libAdsLib.a.p/AdsLib_Log.cpp.obj -MF "libAdsLib.a.p\AdsLib_Log.cpp.obj.d" -o libAdsLib.a.p/AdsLib_Log.cpp.obj "-c" ../AdsLib/Log.cpp ../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); | ^~~~`Any clue?
Regards,
Maurizio.