I’m quite new to UE4 and I’m trying to look through the code to figure out how to get multiple monitors working (I know - deep end) but I find it nearly impossible to do it without intellisense to allow me to go to definitions etc.
Because UE4 uses CMake (or something like that), it doesn’t use the standard includes mechanism VS expects, and because all the paths for includes are not relative to the project or solution intellisense can’t find any header files to build its database. I tried including some additional folders, which solved a few of the lookups, but there are so many folders i can’t put them all in the included folders list (and that seems like bad practice anyway).
I’m sure there must be some easy/obvious thing i’m completely unaware of as surely all the UE devs in the world don’t have to cope without intellisense for the massive codebase all the time.
If someone could explain to me how the CMake build mechanism works with VS, that would really help. I looked through the project properties, but the NMake page doesn’t really help me.
To fix the issue, please disable IntelliSense in Visual Studio. For this, please go to Tools - Text Editor - C/C++ - Advanced - IntelliSense and use the settings as shown below:
If you like to learn more about setting up Visual Studio for Unreal Engine 4 (including additional extensions), please go here:
This doesn’t solve my issue, and it seems presumptuous for you to mark it resolved on my behalf.
First of all what you’re showing me is the default settings where intellisense is on still, not off (so your picture doesn’t illustrate your ‘solution’) and secondly, this doesn’t make intellisense work, it turns it off completely. You seem to have used the image from the documentation for turning it back on, just below the text that reads “UE4 projects now have proper IntelliSense support, including a live Error List and “squiggles”! (See below for how to enable it.)”
If you read my question you would know that I want it on and working to help me find my way through UE4’s massive code base. If this is your way of telling me intellisense CAN’T work with UE4, then I’m kind of appalled that’s the case, especially as the documentation says it can.
Hey there, yeah I agree. Do not disable Intellisense, doing so is essentially reverting us to the age of VI and spamming make compile, to trial-and-error for compile errors.
->> PURE SPECULATION:
A guess at the how, from what I can tell (i.e. my educated guess) UE4’s build tool seems to enumerate the files given via the include paths in your Project.Build.cs, and internally handles the includes and calling the make tool on each and or throws everything into a moshpit.
A guess at the why: it was probably done a while ago (i.e. UE3 or earlier) to ease the headache of include paths for cross referenced / inter-dependent projects / modules / libraries. I.E. note how you selectively include modules in your Project.Build.cs, imagine old school of adding paths of desired modules to your compiler’s and linkers include list. Additionally, the automated build tool’s code is likely eased a great deal in complexity, as a result. All-in-all, it cannot be removed, as it would wreck havoc in terms of backwards compatibility and alter the way we compile and maintain projects (and certainly break the automated build tool).
END SPECULATION <<-
As for how to fix it, I’ve not found a practical way. Intellisense compatibility does not seem to be a priority for Epic. Personally, I just ignore the Intellisense include error and occasionally just uncheck Intellisense errors from appearing in the error list (right click in the error window and uncheck “show Intellisense errors”). Intellisense in UE4 projects will just simply not work up to par as it normally does…
I (and from what I gather, a lot of other UE4 c++ programmers) use VAssistX to supplement intellisense, and it works well enough. VAssistX pre-scans your solution and holds symbols internally (rather than trying to lookup through includes) so it gets around UE4’s nonsense include path method.
Otherwise, welcome to the nightmare of programming in UE4’s version of C++ (does not play well with advanced IDE’s). :(.
Reason behind this, UE uses .Net for compiling your C++ source code. You just indicate .net that you are also including path that project source code located. Now you are free to use create directories from wizard without any problem.