NTNU-IHB / FMI4cpp

FMI 2.0 implementation written in modern C++.
MIT License
95 stars 35 forks source link

Visual studio NOMINMAX #64

Closed ebw44 closed 5 years ago

ebw44 commented 5 years ago

It's not really an bug from fmi4cpp. But under visual studio I get syntax error at line 104 of fmi2/xml/typed_scalar_variable.hpp when I try to include fmi4cpp.hpp in my project. The problem is caused by the minwindef.h that define min and max macros, which break the bounded_scalar_variable::min(). One of the solution is to include fmi4cpp.hpp earlier or define NOMINMAX as suggest here

Though I put a message here in case it help others like me that were not familiar with this windows macro.

markaren commented 5 years ago

For CMake users this should be covered by https://github.com/NTNU-IHB/FMI4cpp/blob/49e6b2b3d381f30d67643085f20a103ee30fb04f/CMakeLists.txt#L32

But Visual Studio is another story I guess