Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows CMake Illegal Token #205

Open
tak5633 opened this issue Sep 6, 2022 · 0 comments
Open

Windows CMake Illegal Token #205

tak5633 opened this issue Sep 6, 2022 · 0 comments

Comments

@tak5633
Copy link

tak5633 commented Sep 6, 2022

Attempted to build Gravity on Windows using CMake and received an illegal token error on the following line: https://github.com/aphysci/gravity/blob/master/src/api/cpp/GravityConfigParser.cpp#L83. The issue appears related to this forum post: https://stackoverflow.com/questions/5004858/why-is-stdmin-failing-when-windows-h-is-included. The issue was solved locally by adding parentheses around the min function (i.e. std::min -> (std::min)). The forum post describes other possible solutions.

This was discovered for Visual Studio 16 2019. Below is the full CMake command that resulted in this issue. Note, the command was issued as part of a PowerShell script.
& $PSScriptRoot\cmake-3.20.1-windows-x86_64\bin\cmake.exe -DCMAKE_INSTALL_PREFIX="../installs" -G"Visual Studio 16 2019" -A x64 -DJAVA_HOME=$PSScriptRoot/jdk1.8.0_201 -DBUILD_EXAMPLES=OFF -DGRAVITY_USE_EXTERNAL_PROTOBUF=ON -DGRAVITY_USE_EXTERNAL_ZEROMQ=ON ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant