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"

VS Code: Code shows errors in IDE, yet builds are successful

I have issues, reminiscent of IDE errors from Visual Studio, were the IDE is putting out false errors, which lead to no or limited intellisense. I have rebuilt the project a few times, re-generated the project, tried to run with Editor open, and closed.

The project does build with no errors, so these are IDE issues, but I do't know if they are caused by unreal setup or VS Code itself.

Also note: This is in a plugin, and it doesn't seem to understand the class SIMPLESOCKETS_API part... there are still errors if I remove it, but it stops saying that SIMPLESOCKETS_API is a class.

Environment: Windows 10, Just clicked Update on VSCode (1.18.1?), 4.18 Unreal.

Basic CCP Basic Header

Product Version: UE 4.18
cpp.png (24.7 kB)
h.png (7.5 kB)
more ▼

asked Nov 24 '17 at 06:04 PM in C++ Programming

avatar image

121 5 7 11

avatar image BugSwat Nov 24 '17 at 06:17 PM

What does it say as "error" when you hover your mouse over the red underlined words?

avatar image tenowg Nov 24 '17 at 06:29 PM

in the header file, the : when hovered says 'expected a ";"'

in the cpp file: On USocketComponent:: it says "name followed by '::' must be a class or namespace name" also same error on Super:: and any variable error reads "identifier 'variablename' is undefined"

avatar image c4tnt Nov 25 '17 at 10:42 AM

It's not an error but just an MSVC inaccuracy. These underlines usually disappear when MSVC finishes to build a program database.

avatar image tenowg Nov 30 '17 at 03:31 AM

so how long should it take to build a program database? its been a very long time and I still get these errors...

avatar image BugSwat Nov 30 '17 at 11:29 AM

It is in most cases for me a missing include. But in most cases I don't want that. The code is building, more includes mean longer build time. So the IDE is not happy. So what? Who cares.

avatar image IribaesRom Dec 01 '17 at 05:38 AM

So what? Who cares.

Really? It's kind of a big deal. This throws off all useful linting from vscode because it's hung on this one error.

Here's an example of why this could be a headache for someone. There's a simple typo that would normally be caught by the linter, but now it isn't. example

avatar image IribaesRom Dec 01 '17 at 05:44 AM

Same problem here. New project, all I've done here is create an Actor C++ file. My environment is macOS 10.13.1, UE 4.18.



avatar image CraftedCart Dec 23 '17 at 08:02 PM

Same issue over here (Linux, UE 4.18.2) - Plonking "C_Cpp.intelliSenseEngine": "Tag Parser", in your VSCode config seems to help (In terms of better tag completion), but then you're left with zero error checking :/

avatar image IribaesRom Feb 26 '18 at 02:42 AM

This is the best I've seen so far. But yeah, still no error checking, so it's not reason enough for me to switch :/

avatar image tenowg Dec 24 '17 at 02:31 AM

I have just continued working on my project while I hope this gets looked at eventually... I just have to build and wait for compile errors to show any typos, etc... also more research is required to remember the methods and properties that intellisense would simply remind of on a regular basis. Fairly annoying... I will try @CraftedCart's option and see if it makes it any better tho.

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

3 answers: sort voted first

As already said, the problem is solved by fixing the file c_cpp_properties.json. I just copied the definitions from the Visual Studio 2017 project and it worked.

The code for c_cpp_properties.json file (works for UE 4.18 and Windows 10) But you need to change the line: "ORIGINAL_FILE_NAME='UE4Editor-ProjectName.dll'"

 "defines": [

more ▼

answered Feb 25 '18 at 10:30 AM

avatar image

46 3 4

avatar image IribaesRom Feb 26 '18 at 02:45 AM

While I agree that the c_cpp_properties.json file is likely the culprit, your solution did not work for me. I may have just copied something wrong, or my project may required different defines than yours, however.

Could you let us know where you found this list? I looked through the .vs files and my VS2017 project and couldn't find any list of defines like this.

avatar image maximangetman Feb 26 '18 at 07:19 AM

In Visual Studio 2017: Project > Properties > Nmake > Preprocessor Definition > Edit (And check the Include Search Path > Edit)

avatar image IribaesRom Feb 26 '18 at 02:10 PM


This is it!!! It totally works :D Thank you so much!!

avatar image XQDD May 29 '18 at 07:00 AM

Work for me, Just change PROJECT_NAME to yours:


By the way, you can find the Definitions at

 YOUR_PROJECT_PATH/Intermediate/ProjectFiles/PROJECT_NAME.vcxproj (NMakePreprocessorDefinitions)

without open Visual Studio

But I will use this in the vs code settings.

 "C_Cpp.intelliSenseEngine": "Tag Parser",

For the reason that the when you flesh vs code in unreal engine, the c_cpp_properties.json will flesh witch annoyed me.

avatar image parityb1t Jun 08 '18 at 06:26 PM

This worked for me yesterday :) But adding a new C++ Class or refreshing the Project code wipes the settings, any workarounds?

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

include "Engine.h" !!!!

in your .h file.


more ▼

answered Dec 26 '17 at 01:52 PM

avatar image

1 1

avatar image Seuen Dec 25 '17 at 12:36 PM

![alt text][1]

like this

vscode.png (26.9 kB)
avatar image tenowg Dec 26 '17 at 11:53 PM

I have added this, and, yes the errors go away, but now I need to know why this happens... before I can say this is the definitive answer.

avatar image Seuen Dec 31 '17 at 01:18 PM

i dont know more. syntax error caused by "InputCoreTypes.h"

avatar image IribaesRom Feb 26 '18 at 02:43 AM

I mean, yeah including "Engine.h" in the code might solve this, but we really should not have to be doing this. There's a reason UE4 stopped that practice.

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

I fixed it by updating my c_cpp_properties.json. The "defines" field can take values in the form of "define=value", so in my case I was working with a FPSGAME_API causing the issue and I made my defines:

             "defines": [

You can probably do something similar with "SIMPLESOCKETS_API="

more ▼

answered Jan 24 '18 at 03:00 PM

avatar image


(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