# Best way to find needed include?

**URL:** <https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 29, 2015, 7:02am UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003 "2015-11-29T07:02:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 29, 2015, 7:02am UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/1 "2015-11-29T07:02:45Z")

</div>

Often times I am looking at code from elsewhere and for whatever reason they sometimes either don’t have, or don’t show the #includes, as something changed in ue4

Is there a good way to find what include I need to include for a particular class, or function?

a lot of times its semi intuitive as its the same name as what I want, but some things are sometimes hidden away, especially macros

e.g.  
ARRAY\_COUNT lives in UnrealTemplate.h

searching the epic’s github for unreal is decent some of the time, but often times it gives many pages of stuff of ‘use’ but not the original implementations location

---

<div class="post-metadata">

**Author:** ![Begounet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Begounet](https://forums.unrealengine.com/u/Begounet)\
**Post date:** [November 29, 2015, 11:28am UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/2 "2015-11-29T11:28:50Z")

</div>

I generally use Ctrl+, in VS and write what I am looking for.  
Didn’t try yet but I think if you typed “ARRAY\_COUNT” with this method, you should find the file quickly.  
For specific function or class, this method should also work but in worst cases (function name is too generic for example), you can search in the documentation and at the end of the page, you have the name of the files that contains theses classes/functions.

---

<div class="post-metadata">

**Author:** ![enlight\_2014](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@enlight\_2014](https://forums.unrealengine.com/u/enlight_2014)\
**Post date:** [November 29, 2015, 12:01pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/3 "2015-11-29T12:01:13Z")

</div>

The [VAX Find Symbol dialog](http://docs.wholetomato.com/default.asp?W194) is invaluable for this sort of thing.

---

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 29, 2015, 5:35pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/4 "2015-11-29T17:35:56Z")

</div>

Ctrl Comma has no response in VS for me? Is this tied to a particular extension or something?

Searching the documentation is sometimes troublesome and doesn’t always provide clear answers. It works some of the time though! and searching github works some of the time, just as searching google does as well. None of them work great though, having to use a mixture of things to find what I need seems less than optimal.

for example if I search [docs.unrealengine.com](http://docs.unrealengine.com) for array\_count  
the first response is for blueprints only, not helpful in this case  
the second response is for [TArray: Arrays in Unreal Engine | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/TArrays/index.html) which even shows USAGE of array\_count, but has no mention of header file/library/where it exists.

---

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 29, 2015, 5:36pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/5 "2015-11-29T17:36:57Z")

</div>

Thanks, that is useful, however it doesn’t seem to work on macros/preprocessor things, and Epic tends to use them a lot 😕

It does however, seemingly appear to work great on more traditional things though. Thanks!

---

<div class="post-metadata">

**Author:** ![Begounet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Begounet](https://forums.unrealengine.com/u/Begounet)\
**Post date:** [November 29, 2015, 5:43pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/6 "2015-11-29T17:43:06Z")

</div>

This shortcut should match the “Edit \> Navigate to…” command.

![68629-navigateto.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/e/78ecf32df9ab398cf9d64340260d4950a07bd0ef.png)

I tried to search “array\_count” and the first result was correct :

 ![68630-arraycount.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/d/9dda69da611d8b910e1adf38b8ec7010f1e6c5cf.png)

---

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 29, 2015, 5:46pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/7 "2015-11-29T17:46:50Z")

</div>

how fascinating, what version of Visual studio are you using?

Aside from installing Visual Assist, I’ve made 0 changes from default Visual Studio 2015 Though I am on an enterprise edition, maybe I should try switching to the community edition?

However, Navigate to, did seem to work!

 ![68632-aha.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/c/7ec914a8090009f7c7584a066b6abb0f2b1ac7fa.png)

![68631-interesting.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/c/fac75aef618d9e71ec36a2f7038c9b04de9c0b28.png)

---

<div class="post-metadata">

**Author:** ![Begounet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Begounet](https://forums.unrealengine.com/u/Begounet)\
**Post date:** [November 29, 2015, 5:55pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/8 "2015-11-29T17:55:16Z")

</div>

The shortcut was ok by default in VS2013/2015 community.  
You can set the shortcut in Tools \> Options…, then Environment \> Keyboard.  
From here, search for “edit.navigateto”, select the line found and set the shortcut you want.

 ![68633-vsshortcutexplanation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/d/18d964c1001c11094a3911c97d2929ce343199bd.png)

---

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 29, 2015, 5:58pm UTC](https://forums.unrealengine.com/t/best-way-to-find-needed-include/340003/9 "2015-11-29T17:58:09Z")

</div>

Thanks! shortcut fixed now. Seems to work quite well for several test cases!

I do wonder why it was unassigned for me. I feel like everything I saw indicated that what you had and now I do as well, are the defaults. Maybe I should try reinstalling VS sometime.
