How do i create .h files using Atom for C++


I am trying to follow this C++ tutorial

And there are no options that I am aware of in Atom to create a .h file. So I created it manually by going to Windows explorer, creating 2 text files and naming it “Classes.h” and “Classes.cpp”. In the “Classes.cpp” file I typed this out #include “Classes.h”

And I got an error that states that there is no such file or directory that exists.

How do I fix such an issue, and also how do I get Atom to automatically create such files?


I don’t know anything about C languages, but you can make a new file in Atom using the standard ctrl-n shortcut. Saving this will prompt for a location. Alternatively, with the tree view in focus, you can right click a folder and select New File, or press a. Both will open a dialogue asking for the new file’s name.


But how come Atom can’t detect my “Classes.h” file?


At no point in there is Atom detecting anything. The program GCC is in charge of detecting your files, and linter-gcc knows how to exchange messages between gcc and linter. I don’t know why GCC can’t detect the header file, and since I don’t program with any member of the C family, I don’t have the ability to troubleshoot it. You should ask someone who has expertise with using GCC to lint code, potentially the developers of the package you’re using.


Oh ok thanks man :slight_smile: