I have a C++ project, where I use CMake as build chain system. Inside a header I am…
- User
I have a C++ project, where I use CMake as build chain system. Inside a header I am using #if (_WIN64) // define something #endif on a Win 64 machine using VSCode, GCC compiler. My expectation is that such macro should be detected but it does not. Any idea about how to solve such issue?
- Assistant
The issue you're experiencing is likely due to the
_WIN64macro not being predefined when using the GCC compiler on a Windows machine. The_WIN64macro is typically predefined by Microsoft's MSVC compiler when targeting 64-bit Windows platforms, and may not be available or properly set when using other toolchains like GCC, especially on Windows.