• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Cannot find ScriptPCH.h include custom scripts?

Status
Not open for further replies.

GanjaNoodle

Respected Member
I cloned a fresh ElunaTrinityWotlk source and when I added Rochet2's reforging script for example (or any other custom script, might be a general include problem), though git apply Reforging.diff and applied without errors. It can't find the ScriptPCH.h in the Reforging script. The header wasn't in the header files but the ScriptPCH.cpp was in the source files. I added the header manually but it still gives me the errors. When I include everything that ScriptPCH.h includes there are no errors, but yeah... that's just a hackfix.
 

GanjaNoodle

Respected Member
Yeah you're right, no errors with manual include. This was already solved then lol. What's the use of that file then? It was still in the source.
 

Tommy

Founder
Yeah you're right, no errors with manual include. This was already solved then lol. What's the use of that file then? It was still in the source.

It is a precompiled header file that includes other related headers so you won't get 'undefined' errors. CMake was updated awhile back to not make it mandatory to include (as far as I know that's what happened).
 

Rochet2

Moderator / Eluna Dev
The file speeds up compiling process since the scriptpch has common headers and it is precompiled to a form that is easier to be used when compiling other files.
Without the file compiling takes forever and the size of the files and probably required ram etc for compiling is a lot higher.
Previously on mangos the PCH file was not used by compiling and a single cpp file compiled to obj took almost 20mb. After using PCH the compiled PCH file was 20mb, but all other files were only 1-200kb. Considering that about 20mb of information was preprocessed and was not needed to be processed for probably hundreds of times (once for each cpp compiled), the compilation process was sped up a lot.

In computer programming, a precompiled header is a (C or C++) header file that is compiled into an intermediate form that is faster to process for the compiler. Usage of precompiled headers may significantly reduce compilation time, especially when applied to large header files, header files that include many other header files, or header files that are included in many translation units.
-wikipedia


PS. I dare you to uncheck the scriptPCH and corePCH in cmake!
 
Last edited:
Status
Not open for further replies.
Top