Hey there,
I’ve been somewhat boggled by this C1001 compile error I’ve been running into. It only happens when building for development editor builds in VC and hot reload in editor. It is not present in Debug editor builds at all.
c:\**\source\bblpnyutil\private\animationbatchmeta.cpp(104): fatal error C1001: An internal error has occurred in the compiler.
2> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 255)
2> To work around this problem, try simplifying or changing the program near the locations listed above.
2> Please choose the Technical Support command on the Visual C++
2> Help menu, or open the Technical Support help file for more information
2>
Where line 104 of that file has the following function
bool UAnimationBatchMeta::GatherConfiguration(FAnimationBatchConfiguration & o) const { // <-- C1001
bool any = false;
o = FAnimationBatchConfiguration();
for (TSubclassOf<UAnimationBatch> klass : Inherit) {
any |= (*klass != nullptr) && klass.GetDefaultObject()->GetConfiguration(o);
}
any |= UAnimationBatch::Solidify(Overrides, o);
return any;
}
if i replace the code found there with the following below it compiles…
bool UAnimationBatchMeta::GatherConfiguration(FAnimationBatchConfiguration & o) const {
bool any = false;
//o = FAnimationBatchConfiguration();
//for (TSubclassOf<UAnimationBatch> klass : Inherit) {
// any |= (*klass != nullptr) && klass.GetDefaultObject()->GetConfiguration(o);
//}
//any |= UAnimationBatch::Solidify(Overrides, o);
return any;
}
As long as I do not iterate the klasses it seems to compile…
bool UAnimationBatchMeta::GatherConfiguration(FAnimationBatchConfiguration & o) const {
bool any = false;
o = FAnimationBatchConfiguration();
//for (TSubclassOf<UAnimationBatch> klass : Inherit) {
// any |= (*klass != nullptr) && klass.GetDefaultObject()->GetConfiguration(o);
//}
any |= UAnimationBatch::Solidify(Overrides, o);
return any;
}
So i got to thinking it could be GetConfiguration which is a virtual function, so i replaced it as below and the C1001 returned again ( the error comes up fairly quick in both C1001 versions )
bool UAnimationBatchMeta::GatherConfiguration(FAnimationBatchConfiguration & o) const {// <-- C1001
bool any = false;
o = FAnimationBatchConfiguration();
for (TSubclassOf<UAnimationBatch> klass : Inherit) {
any |= (*klass != nullptr) && UAnimationBatch::Solidify( klass.GetDefaultObject()->Configuration, o);//<-- uses the same fuction that compiles after this loop.
}
any |= UAnimationBatch::Solidify(Overrides, o);
return any;
}
So at this point I’m wondering if perhaps I’m using the “Inherit” member incorrectly or if there is some bug?
The “Inherit” member is declared as below for reference. its a TArray of TSubclass.
UCLASS()
class BBLPNYUTIL_API UAnimationBatchMeta : public UAnimMetaData
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
TArray<TSubclassOf<UAnimationBatch> > Inherit;
#if WITH_EDITOR
UPROPERTY()
TArray<FAnimationBatchCache> InheritCache;
#endif
UPROPERTY(EditAnywhere)
FAnimationBatchConfiguration Overrides;
UPROPERTY(VisibleAnywhere)
FAnimationBatchConfiguration Final;
UPROPERTY(VisibleAnywhere)
uint8 HasFinal : 1;
UPROPERTY(VisibleAnywhere)
uint8 PendingAnimations : 1;
#if WITH_EDITOR
UPROPERTY(EditAnywhere)
uint8 ApplyToAnimation : 1;
#endif
UAnimationBatchMeta(const class FObjectInitializer& ObjectInitializer);
...
Any tips/suggestions would help greatly. I’ll follow up with a post if I manage to determine the issue myself Thanks
Also, after writing this I noticed that maybe I was wrongly iterating and tried the following variants of the foreach loop. none of which compiled.
these 3 result in the same C1001 pointing at the start of the function implementation.
for (const TSubclassOf<UAnimationBatch>& klass : Inherit) {
for (const TSubclassOf<UAnimationBatch> klass : Inherit) {
for (TSubclassOf<UAnimationBatch> klass : Inherit){
this of course didn’t result in the C1001, but a different error because its a const member (so did not compile)
for (TSubclassOf<UAnimationBatch>& klass : Inherit){
then for sanity sake, i switched to a regular old for loop. this also results in the same C1001.
for (int32 i = 0; i < Inherit.Num(); i++) {
const TSubclassOf<UAnimationBatch>&klass = Inherit*;
any |= (*klass != nullptr) && klass.GetDefaultObject()->GetConfiguration(o);
}
Yet further… I decided to drop the function call entirely. And i still get the C1001
for (int32 i = 0; i < Inherit.Num(); i++) {
const TSubclassOf<UAnimationBatch>&klass = Inherit*;
any |= (*klass != nullptr);
}
when i have it check for the default object it does not compile.
for (int32 i = 0; i < Inherit.Num(); i++) {
const TSubclassOf<UAnimationBatch>&klass = Inherit*;
any |= (nullptr != klass.GetDefaultObject());
}
so i moved on to try the UClass * implicit operator , still have C1001
for (int32 i = 0; i < Inherit.Num(); i++) {
const UClass *klass = Inherit*;
any |= (klass != nullptr);
}
So i’m planning on swapping out usage of TSubclassOf with plain old UClass* but this will take awhile to test (and is not really ideal from the UI front end POV).
UPDATE:
I did as mentioned above, replaced usage of TSubclassOf with UClass* which was fruitless.
the declaration of Inherit now:
UCLASS()
class BBLPNYUTIL_API UAnimationBatchMeta : public UAnimMetaData
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
TArray<UClass* > Inherit;
#if WITH_EDITOR
UPROPERTY()
TArray<FAnimationBatchCache> InheritCache;
#endif
UPROPERTY(EditAnywhere)
FAnimationBatchConfiguration Overrides;
UPROPERTY(VisibleAnywhere)
FAnimationBatchConfiguration Final;
UPROPERTY(VisibleAnywhere)
uint8 HasFinal : 1;
UPROPERTY(VisibleAnywhere)
uint8 PendingAnimations : 1;
#if WITH_EDITOR
UPROPERTY(EditAnywhere)
uint8 ApplyToAnimation : 1;
#endif
UAnimationBatchMeta(const class FObjectInitializer& ObjectInitializer);
...
and the function the compiler states is the issue:
bool UAnimationBatchMeta::GatherConfiguration(FAnimationBatchConfiguration & o) const {//<-- C1001
bool any = false;
o = FAnimationBatchConfiguration();
for (int32 i = 0; i < Inherit.Num(); i++) {
UClass *const &klass = Inherit*;
any |= klass != nullptr;// && nullptr != Cast<UAnimationBatch>(klass->GetDefaultObject());
}
any |= UAnimationBatch::Solidify(Overrides, o);
return any;
}
Note that if the Cast<> call there is commented out, and still results in a compile error C1001. Again if I comment out the entire for block in the code, it compiles (but it does not do what I intented.)
Again, any tips would be greatly appreciated! I’m going to temporarily retire focus on this issue and stay with Debug Editor builds for now and cross my fingers that I don’t lose assets when I eventually accidentally launch through epic games launcher.
Further info: long before I posted this I searched for what could cause the C1001 specific to UE4, and besides the various answers which were marked as resolved due to inactivity the only other suggestion is that its a CPU issue and can be resolved by not-overclocking your CPU. While I’m hesitant to come to that conclusion, to the best of my knowledge my board is not overclocking the CPU (even though I do have a i7-4960X which is intended to be overclocked). I’ve attached a picture of dxdiag.
Thanks