Why is there no main.h file in a?

I just started learning Openframeworks and while I can run my code without problems, I don’t understand one thing:

When I create a new project with the ProjectGenerator there are only three files in the src directory:

  • main.cpp
  • ofApp.h
  • ofApp.cpp

Both, main.cpp and ofApp.h include a non-existing(?) main.h. Why is it not there?
Also I don’t have to include standard libraries like <iostream>, it seems they are already included. Are those included in this hiding main.h file?

It’s not hidden. it is included in Header Search Paths in Build Settings.
The path is as following.
../../../libs/openFrameworks/ofMain.h
And yes, standard libraries are already included.

Thank you cuinjune!
I already thought something like this, but couldn’t find a specific line of code pointing this out.

Just for a better understanding (I’m also not an expert in build systems yet), how exactly does it work, that there is a generic main.h used. And what are the advantaged/disadvantages of this approach?

it is not main.h but ofMain.h, it’s not the header for main.cpp but the header that includes all of openframeworks itself

If you add the library as search paths, you don’t have to copy all the files into your project whenever you create a new one. So your project folder can separately exist from the library and only have the project specific files in it.

it’s not the header for main.cpp

I might get you wrong here, but if that is not the header of the main.cpp, then where is it?

main.cpp doesn’t have or need a header, a cpp only needs a header in order to call the functions in it from other files but since main.cpp only contains the main function which is only called by the operating system itself it doesn’t need a header