Closed PucklaJ closed 1 year ago
Compiler version and language standard?
You can look at the complete build process if you look at the PR mentioned above. This syntax error occurs on MSVC 2022 and 2019 versions. The language standard is set to C++17 using the -std:c++17
flag (I also tried /std:c++17
but this changed nothing).
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" -c /EHsc -nologo /MT -std:c++17 -DBOOST_ALL_NO_LIB -external:W0 -external:IC:\Users\runneradmin\AppData\Local\.xmake\packages\f\fmi4cpp\0.8.0\334f1334676140cab16485e916dbec1e\include -external:W0 -external:IC:\Users\runneradmin\AppData\Local\.xmake\packages\b\boost\1.78.0\e7f230f8b6e74f199a0c2484f358c00c\include -external:W0 -external:IC:\Users\runneradmin\AppData\Local\.xmake\packages\l\libzip\1.8.0\4fbc31ec5b664147aa73660680c2d2ba\include -external:W0 -external:IC:\Users\runneradmin\AppData\Local\.xmake\packages\z\zlib\v1.2.11\a593fa3f71e64cf790ec96898b34de8a\include -FoC:\Users\RUNNER~1\AppData\Local\Temp\.xmake\220407\_B65BA9F833D04C7086C8034C023CCBA0.o C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\220407\_43FD57E494514C708E3879676CE133D0.cpp
This is the entire compiler call for Windows MSVC 2019 static x64 MT
I will update the windows CI and see if there are any issues with the new compilers. VS2016 is deprecated in GitHub Actions anyway.
I've updated the CI workflow and VS2019 should work fine. VS2022 wasn't happy with boost and pre-built binaries for conan don't seem to be available for that compiler yet. Updating boost and libzip led to issues with bzip and I rather not open that can of worms as it works fine for VS2016, VS2019, gcc 7 and 9. As long as conan works, I'm kinda satisfied.
I had a similar problem with vcpkg distribution of fmi4cpp. In my case it was related to the definition of min and max functions in windows.
Adding add_definitions(-DNOMINMAX)
in CMakeLists.txt or the following in the file(s) that includes fmi4cpp fixed the issue
#ifndef NOMINMAX
#define NOMINMAX
#endif
I have the same problem as you. How can I solve this problem?
Closing this one. The issue is related to external macros (min/max) and not fmi4cpp
itself.
I am trying to add FMI4cpp to the xmake-repo. Link to PR. After solving some other issues I stumbled over some syntax errors.
Could someone help me determine what the issue is. I can't see any error in the code.