Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UCLASS() error

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?

Product Version: UE 4.9
more ▼

asked Sep 08 '15 at 06:58 PM in C++ Programming

avatar image

31 1 2 6

avatar image Doug E ♦♦ STAFF Sep 08 '15 at 08:02 PM

Hey Sheed-

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.


Doug Wilson

avatar image Sheed Sep 08 '15 at 11:31 PM

Hmm,this is very odd.

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Sep 08 '15 at 11:38 PM

avatar image

246 5 12 20

avatar image Sheed Sep 09 '15 at 12:13 AM

This removes the errors,thanks.

Unfortunately,I have to do this everytime I make changes above the UCLASS macro :/

avatar image xulture Sep 09 '15 at 12:16 AM

Yepp but repeated compilations are relatively fast, after the big build.. :-)

avatar image jayice Oct 07 '15 at 08:45 AM

I just have to say this, "IntelliSense" is far closer to "IntelliStupid"

Please Please Please, consider a Feature Request of support Eclipse...

avatar image SouldomainTM May 01 '16 at 03:56 PM

I don't know that for a fact, but I always thought this problem is only related to the headers themselves, and not VS.

avatar image Sorrien Mar 09 '17 at 01:35 AM

VS Intellisense works just fine for other languages/engines.

avatar image wasil12345 Jul 04 '16 at 09:41 PM

I;ve did it once and it worked, but right now after changing again, repeating same process it do not work.

avatar image Ninjin Mar 17 '17 at 12:51 AM

There is no DevelopmentGame configuration by default, how did you get that?

avatar image xulture Mar 17 '17 at 03:25 AM

Just switch between whatever you are using. Eg 'DevelopmentEditor' and 'Development'... or 'DevelopmentClient'..

Forces intellisense to reinit its dependencies

avatar image guzzard Jun 09 '17 at 09:02 PM

to solve the issue with UCLASS() intellisense error when adding/removing lines in the header file I have to do two steps.

  1. UE editor: compile

  2. VS: switch to for example "deveopment" or any other config, and then back to "development editor".

This is with UE 4.16.1 and VS2017. It's the only solution that has worked for me..

avatar image LZDLY Oct 04 '17 at 04:33 AM

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 ?

your unreal and vs version is as the same of mine

avatar image xBazilio Jul 07 '17 at 09:24 PM

With QtCreator swapping Build configuration also does the trick!

avatar image WouterDB Sep 13 '17 at 05:54 PM

Thanks! Changing between "Development Editor" and "Development" solved the false positive errors for me!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Go to build --> configuration Manager --> then change the active solution platform from Win64 to Win32 or vice verse

more ▼

answered Jul 09 '17 at 10:48 PM

avatar image

13 2 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question