C++ Coding Error (MSB3073)

Hello, according to the output log, a “Circular Dependency” was detected in my project. I’ve been looking for a solution to this for days.

Can someone help me?


I’m sure you meant to #include “AttributeSet.h”

but you’re just including your own header.

1 Like

Yes, you were right, that was the solution. But now I get a lot of syntax errors.

I hope the errors in German are not a problem for you

Ok i found it you made a small spelling error in ClassName in the macro so it should be this:

#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
 	GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
 	GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
 	GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
 	GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)

In your code this line has ClassName without capital N like so:

GAMEPLAYATTRIBUTE_PROPERTY_GETTER(Classname, PropertyName)

The include error from your character source files i can’t tell without seeing the include line.

1 Like

Thanks, that has already solved the syntax problem.

Can you tell me how to show you the include line, haven’t done that before.

Do you need this information?

Can’t see what’s wrong immediately but try replacing that #include “AttributesSet.h”
with the full path to the header something like this

#include "E:\Snort\Source\Snort\gas\SnortAttributeSet.h"

but your path to the file.

Sometimes it will pick up the include path during full rebuild so you could try that aswell.

1 Like

Thanks, that also worked, but now I have another error

So on line 96

if(SpecHandle.IsValid))

should be

if(SpecHandle.IsValid())

Also to preempt add the OnRep function to the attribute uproperty like so

UPROPERTY(BlueprintReadOnly, Category = "Attributes", ReplicatedUsing = OnRep_Health)
        FGameplayAttributeData Health;

The ReplicatedUsing binds the OnRep function

1 Like

Thanks, that also worked, but now I have another error

You forgot the closing “)” on your if statement.

Cool relatively new thing in c++ is you can use auto like so:

for(auto& StartupAbility : DefaultAbilities)
{
     ... 
}
1 Like

u mean it so?

Yeah also it’s

TSubclassOf<UGameplayAbility>

You can avoid things like that by using auto.

2 Likes

You can’t include attributesset.h header inside the of attributesset .h.
Other than that if any other of the included headers include attributesset.h then the circular dependency will remain.

It’s better to include headers in cpp files and use forward declarations with the prefix “class” in your header files.

Thank you very much, it works perfectly now. Under what name may I put you in the credits?

You’re welcome. ezgoin is what i’m gonna go by. I’ll be hanging around here quite a bit so i’ll try to help if i can.

1 Like

Can you please help me with something else?

Everything is fine with the code, but the AbilitySystemComponent is not added after debugging my BP_ThirdPersonCharacter. So I have no way of using my new system

You mean in the character blueprint? It’s not in the component tree it’s with the movement component right beneath the tree in the blueprint components window of the character blueprint.

Yes, exactly, and the AbilitySystemCOmponent should normally be displayed there after debugging

If you created it correctly in the constructor and added a uproperty to the class header what might help is restarting unreal editor and/or do a full rebuild of the code.

I have now done a complete rebuild. Nothing has changed.

What would you need to see to check if everything is correct?