C++ BTTask and BTService not working!

Everytime i create a BTTask or a BTService it is not compiling and not letting me compile my code until i fix the problem.


Could you provide a bit more information regarding your issue:

  • A description of what you’re trying to accomplish overall
  • Your full .h and .cpp files where you are seeing the error
  • The error message(s) that you are receiving.


this is when i create the class i get this in the output log link text

Do you have the AIModule included in your build.cs file?

link text
Here is the build file i included the AIModule and it is not working still

Thanks for the information. Could you please provide the full code that you are using so I can take a closer look to see why you’re getting these errors?


I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

It looks like you need both “AIModule” and “GameplayTasks” included in your build file to compile new BTService child classes. These are not included by default as of build 4.15

1 Like

This is due to the header file changes that were made in 4.15 to decrease compile times. As a result, you’ll sometimes need extra includes that weren’t necessary prior to this.

Thanks, this solved my problem. Here I was thinking I did something wrong (not quite used to building in general). Can you tell me where this information is from and how you knew this was the error? Is there some official information page about this?
It’s a little frustrating just adding a C++ class and the compile failing, without you even knowing where the problem lies or whether this is an Unreal problem or VS problem etc.

Thank you Noros! You solved my problem! Googled it for an hour… Build 4.17.1 - the “problem” is still there. No additional includes in the header, the editor generation worked fine with that. Just an additional module in the *.Build.cs file.

Dear Sean, would be nice to have updated documentation at least. :slight_smile: Adding “GameplayTasks” on this page in “Module” row (in the bottom). This would save hours for newbies like me. :slight_smile:

Hey Omony,

We are working towards getting all of our documentation up to date, but unfortunately some things are still a bit outdated, especially when it comes to changes that were made due to the header file changes in 4.15.

I’ll go ahead and throw in a ticket to see if we can get this added to that page to prevent confusion in the future.

Thank you for the suggestion.