Did I set up my Visual Studio wrong?

Hi,

Noob question incoming!

So I’m trying work along to some primitive UE4 tutorials (C++ Battery Collector: Making Your First Pickup Class | 03 | v4.9 Tutorial Series | Unreal Engine - YouTube) in C++. The problem is that I didn’t get Visual Studio to work with UE4 the way it is supposed to. Intellisense is giving me ridiculous errors allthough I made sure to check UE4-support during the installation. Here are some examples of dumb errors:
222746-

(Btw. I am using UE4.18 and VS2017-Community.)

Did maybe someone else encounter similar problems in his early UE4 days and knows, what I am doing wrong?

Thanks in advance!

Have you tried compiling the code through the editor?

I constantly face such “ridiculous errors” but the code compiles and works as expected. I may be wrong (sure hope so), but unfortunately it seems Intellisense is just not suited for Unreal… so I just “learned” to mostly ignore it and pay attention to error logs in Unreal.

Instead of using Visual Studio 2017 I suggest you to use Visual Studio 2015 community. B’cause i have both VS 2017 & VS 2015 so , when i used VS 2017 it was showing error but when i used 2015 Visual Studio then then okay . I’m think so they don’t have configuration of Visual Studio 2017 community with Unreal Engine 4 yet , I’m not sure may be they are in progress .

Thanks for the quick response.
Yes, the code did allways compile flawlessly in the editor, I was just annoyed, that my IDE would allways remind me of non-existing errors… I guess this can’t be helped at the moment.

Thanks for the suggestion, I’ll try that ASAP.

Agreed. If you have both 15 and 17 installed, go with 15. I tried to get rid of 15, but nothing I could do actually got rid of everything so I reformatted and installed only 17. Works perfectly now.

So first of all switching to VS2015-Community made all my existing code ‘incompatible’, that sucks. Besides that most of the errors are gone, except the one you can see in the picture “error2.png”. That one is still here…

Just to wrap this up, here’s what I discovered as best practice after a lot of trial an error (got all errors to disappeare):

  1. As allready stated ealier, switching to VS2015 may be a good idea (it solved some of the errors in my code).

  2. In your header files do NOT include other header files under the “[YourClassName].generated.h” line.

  3. Generally things work out best for me, if I go with forward declaration in the header files and full including in the .cpp files.

In the end this isn’t important at all, as long as the compile process inside the editor works, but if you’re like me, removing those red wavy lines under your code is just way more satisfying :wink: