CLion can't create classes
Answered
I'm having the same issue as this person from this stack overflow thread:
https://stackoverflow.com/questions/46673640/clion-cmake-no-rule-to-make-target
I create a project. Run main.cpp. Works successfully. Then I create a C++ class. Then I got this error:
mingw32-make.exe: *** No rule to make target 'test2'. Stop.
Deleting the new class doesn't fix this error. Here's CMakeList.txt:
cmake_minimum_required(VERSION 3.9)
project(test2)
set(CMAKE_CXX_STANDARD 14)
add_executable(test2 main.cpp test2.cpp test2.h)
Please sign in to leave a comment.
Hi, Erik! Does the issue persist after Tools | CMake | Reset Cache and Reload Project?
Yes, it still persists.
Erik, unfortunately, I can't reproduce the issue with CLion 2018.1 and MinGW (version: w64 5.0):
What CLion version do you use? Could you please try the latest stable (2018.1.1)?
Do you use bundled CMake or custom? Is it possible to record a screencast illustrating the issue? Please also share the whole error message.
Thanks Anna,
I clicked on "checked for updates" in the "help" drop down menu. Updated to the latest stable version, and that fixed the problem.
Hello, I am having this same issue and have tried everything on here and updated my CLion version to be 2018.3.4. Not sure what to do as have tested this with new projects and run the hello world test program. That works but then I just made an empty class and it then stops to work giving this error.
It’s been about a year since I had this issue, but if I recall correctly, moving the project onto my C Drive might’ve actually solved the issue instead of the update. My project was originally on a flash drive which may have been the original source of the problem
Ahh, thanks so much. I am also running off a flash drive. Now running from my C drive and all working.
We've made some test on our side. According to the testing results:
So it looks like a MinGW-related issue. A workaround is to use MinGW-64.