Error Expected *.h to be first header included.

Sorry, I don’t speak English well.

I tried to package the plugin.
(My plugin is using PrivatePCH.h.)
so it output this error.
“Error Expected *.h to be first header included.”
I wrote “PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;” in Build.cs
I tried ↓, but I could’nt.
Delete folder Binaries, Intermediate.
Generate Visual Studio project files.

Inside each .cpp files the corresponding .h has to be the first header included.

#Test.h

#pragma once
class a {};

#Test.cpp

#include “Test.h” // Corresponding header file
#include “Whatever.h”
1 Like

Where does Include PrivatePCH.h ?

Try as the second header of your .cpp files.

#include "Test.h"
#include "TestPrivatePCH.h"
1 Like

Sorry for my late reply
It solved in that way