"No such file or directory"? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

"No such file or directory"?

In my project in Code::Blocks I have 3 files: main.cpp, myclass.cpp, and myclass.h. When I try to compile, it says "No such file or directory". How can I fix this?

20th Aug 2019, 9:02 AM
Yavor Hristov
Yavor Hristov - avatar
4 Answers
+ 3
You probably need to specify the file path.
20th Aug 2019, 9:49 AM
Sonic
Sonic - avatar
+ 1
Hi. You probably need to setup a project in code::blocks. Choose the files to be used along with the project, set some compiler options if needed, and specify where the output goes. Most likely you will be starting building a so called "console application". Hope that helps. Cheers. C
20th Aug 2019, 10:04 AM
ChrA
ChrA - avatar
+ 1
Hi. Usually you create a new project using file -> new -> project. Choose Console Application and C++ or C if you prefer, set title and folder location, some settings will follow, but these should be fine as they are. And you are finished. Now you can either add files from different locations or place them in the source folder et cetera. Browse the documentation to get an idea of how projects are assembled. Probably read into cmake or other make environments. Cheers. C.
20th Aug 2019, 1:55 PM
ChrA
ChrA - avatar
0
How do I do that though?
20th Aug 2019, 11:34 AM
Yavor Hristov
Yavor Hristov - avatar