How to build desktop windows app?
Hello!
First off, I'd like to see I'm really excited to use CLion in the future for the C++ framework I develop for and with (cinder). I've recently begun writing CMake files for it, since up until now we've been manually maintaining Xcode and Visual Studio project files (planned linux support will be via CMake). I started with Mac desktop and have had good experiences, you can find that work in this branch.
Now, I am beginning on Windows support. Essentially, we would like users to be able to just use CLion insead of Visual Studio if they pleased, though I'm not 100% sure our usage of macros yet accounts for that, or perhaps it is because I tried to build with mingw's gcc instead of nmake. The problem I am seeing is that, when using mingw gcc, _MSC_VER seems to be undefined, a variable which we rely on to determine what features the current compiler has (specifically, if the std memory header is available, here).
In the end, on windows we primarily need to build desktop applications, so my main question is this: can I do this with mingw / gcc, and if so will I need to adjust the preprocessor checks to determine what features are available (in other words, add checks for gcc). Or, do we need to use Microsoft's nmake, and is this / will it be supported with CLion?
Thanks for the help, or any suggestions / insights from those who have experience in these matters.
cheers,
Rich
Please sign in to leave a comment.
Yes, it is possible to write desktop applications using mingw/gcc. The _MSC_VER macro is specific to Visual Studio compiler, therefore it is not defined by GCC, so you'll need to use other checks.
At the moment CLion does not support Visual Studio compiler toolchain, and it is unlikely that it is going to support it in the foreseeable future, because this is covered by another product by JetBrains: ReSharper C++.
Thanks for getting back to me. Okay, I'll try adding gcc checks as we need to do this anyway. Though one of the reasons we're looking to CLion is that it would provide us with a cross-platform IDE solution, and its hard to sell to clients that we're going to be building them a windows app without microsoft's native compiler toolchain. Seems like a good post 1.0 feature for CLion, and I'd be willing to place a feature request for this if there isn't one already.
On the other hand, it'd also be cool if CLion supported clang on on windows, if and when this was mature enough to do so.
Clang on Windows is supported. You can install it using MinGW or Cygwin package managers.
Ah cool, good to know.