Hello.
I receive this UCLASS error : " this declaration has no storage class or type specifier " whenever UCLASS isnt exactly on line 7,so therefore I can’t write anything above it.I’m receving this error even in the template projects.
I tried reinstalling both Visual studio and the engine but that didn’t fix it.Does anyone know what might be causing this problem?
Could you post the errors Visual Studio provide when trying to compile? After creating a new class based on Actor, the default setup has the UCLASS macro on line 8. Adding blank lines above the UCLASS marco did not affect the build process either.
When I create a new class based on Actor,for example,like you said and then when I try to add code above the UCLASS macro or just some blank lines, I’m getting these errors in my error list:
1 (2 and 3 are the same) IntelliSense: name followed by ‘::’ must be a class or namespace name;
4 IntelliSense: this declaration has no storage class or type specifier;
5 IntelliSense: expected a ‘;’
The interesting part is I successfully build my project even with those errors,and when I close Visual Studio and open it again,the errors are gone.
If it compiles correctly, even when IntelliSense is complaining, do this:
Change to DevelopmentEditor configuration, compile; Change to DevelopmentGame configuration, compile. This gets IntelliSense to recompile and rescan headers and everything works fine again.
This often happens when you alter the lines in your .h code, above the declaration of UCLASS but it can affect other types too.
is it because of new version of unreal (4.15) , IWYU Conventions makes every .h file can’t include other thing ,and we should keep .h file default #include structure ?