how to save a .cpp file as .exe with clion?

Answered
Hello friend, I started using the clion a short time ago and I have a little problem, I wrote a code and saved it as .cpp and compiled it normally with code blocks, however I need this file as an executable in .exe, I don't know how to do it this, can someone help me?
1 comment
Comment actions Permalink

Hello!

CLion does not provide its own project model for your code but supports the following formats:

* CMake
* Gradle (only the new Gradle C/C++ projects)
* JSON compilation database
* Makefile

It means that your project should be based on one of these formats so that you could work with it in CLion.

The easiest way to start is the following: `File | Close Project`, select `New Project` on the Welcome screen > `C++ Executable` > `Create`. After that you can copy the necessary code and past it into this project. Or you can past your .сpp files into the created project's folder and add them to the target in the CMakeLists.txt (https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html#addtargets-reload).

Please read our quick CMake tutorial - https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html, it will help you.

0

Please sign in to leave a comment.