简体   繁体   中英

Clion with more than 1 C file

So i have been using VSCode and back there I had only to make new file save as .C and when I pressed the "run" it automaticly created the "exe" file by themself.

This method is important to me because as I am on programming class, I have the ABCDEF ... exercise to run.

I heard Clion was one of the best tools out there for C, and i have a student acc so decided to try. But here when I create a new project it only lets me run the first file, tried to add a new source file but it fails.

Is there any solution ? Thanks

这是在 VSC 上

CLion uses CMake as makefile generator. I think this question is about CMake "language" and not about CLion. With CMake you can create multiple executables but there is no automatic way to do it.

You can't have more than one source file if you want it to run independently in the same project. As you may know there should be only one main function where the program initiates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM