number of sections exceeded object file format limit: compile with /bigobj #1255
-
Hello, I am not an expert on how compiliers and linkers work. My understanding is very basic in that regard, so as far as I know, at compile time all includes are copy/paste in the respective files that use them. The result is know as a translation unit that is then compiled into a .obj. So each translation unit becomes a .obj. And finally, the linker does its magic with all the .obj cleaning up all the duplicate code. I will start to check if I can get ride of some entt.hpp includes, but I don't think I can. I always though it was safe to include as required and trusting the compilers to do the clean up. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
This is relatively normal for cpp, depending on the code. |
Beta Was this translation helpful? Give feedback.
-
awesome, thank you both. |
Beta Was this translation helpful? Give feedback.
The
#include
directive that c++ inherited from c copy pastes the contents of the file at the place#include
is called.Right next to
entt/entt.hpp
there is alsoentt/fwd.hpp
which provides forward declarations. Then, there are all the subfolders with specific features that you might be using.https://github.com/skypjack/entt/tree/master/src/entt
Here is the top level
entt.hpp
, as you can see it includes all the files in the subfolders. Instead you can include eg:entt/entity/registry.hpp
if you are mostly using just the ecs part.Also take a look at the
entt/fwd.hpp
, it itself includes a buch of forward declaring files in the subfolders, so you probably don't need them all.