Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I configure a CMake target with CLion (Nothing to run on)?

I'm struggling to run a program with CLion on Windows 10. It was working fine a couple weeks ago and the only thing I could think of that might have broken things is installing git.

As you can see from the below picture, the run button is greyed out and the run configuration says "Nothing to run on", which I'm guessing refers to the target.

enter image description here

What I've done So Far

I tried going through the steps outlined in the accepted answer of this question: How do I set up CLion to compile and run?

  • I installed MinGW in C:\MinGW
  • Added C:\MinGWand C:\MinGW\bin to the path
  • I've configured paths to my Environment, CMake, Make, C Compiler, and C++ Compiler

enter image description here

  • I've set my target & executable, but the only target I can choose is 'All targets'.

enter image description here

If I run this program through 'Run->Run...' and select the 'Wahum' run configuration, I get the following output in my Event Log:

Error running 'Wahum': Cannot run 'Wahum' on '<default>'
like image 377
karobar Avatar asked Dec 31 '22 06:12

karobar


2 Answers

I have CLion 2020.2.1 and there is no import project option in the file menu.

my working solution:

File > Invalidate caches and restart

like image 200
RadiatedMonkey Avatar answered Jan 04 '23 03:01

RadiatedMonkey


What worked for me is selecting the top CMakeList.txt file, right-clicking on it and selecting Load CMake Project from the context menu.

enter image description here

like image 27
Daniel Avatar answered Jan 04 '23 02:01

Daniel