Further project structure #9
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @louishamelers! Thanks for the question because we've had a similar questions on header placement a few times now. Forgive me because I'm going to provide a long-winded explanation for clarity. If you take a look at the sources := $(call rwildcard,src/,*.cpp)
...
compileFlags := -std=c++17 -I include The The headers are never considered as translation units, meaning that they are pretty much orthogonal to the compilation process. They only get seen by the compiler if you mention them in an Another interesting thing about those
Everything should compile just fine as long as you mention in your
And the only change needed would be to tell Also nothing stopping you from putting them next to each other:
The main point is that the compiler needs to know which source files to compile (which we've designated as anything in Additionally, I started this reply by mentioning another line from the You can technically put files in there, and reference them without relative path (as so: If you did want that kind of syntax for includes, but you didn't want to be rude, you could just... add a cheeky little Getting to the point, the answer here is that there are tens of approaches to how you setup your build system and using Make. The template is incredibly flexible so if you want to take a look into how you'd go about making adjustments, just check out our doc explaining the Makefile line-by-line. Additionally if you want some inspiration on how configurable the structure of the project is, you can take a look at our test-pilot project which, starting from this template has evolved to suit the needs of a game engine, and which we continue to use as a proving ground for the robustness of the template. Let me know if the response appropriately covers all your questions (and probably a lot more you didn't ask). I also sincerely hope that I am correct in my assumption of why your implementation didn't compile and it's not some weird Windows issue (as Windows often supplies). |
Beta Was this translation helpful? Give feedback.
Hi @louishamelers!
Thanks for the question because we've had a similar questions on header placement a few times now. Forgive me because I'm going to provide a long-winded explanation for clarity.
If you take a look at the
Makefile
, you'll see the following lines in the first paragraph or so of code:The
sources
macro line will essentially generate a space-separated list of filepaths to all files ending in.cpp
, inside the foldersrc
(recursively) to be used as "sources". Thus, all of these will be compiled into objects (.o
files) that are then linked into the executable.The headers are never considered as …