I am writing a simple C++ program to interface with Twitch, however there is no good way of adding in the Chatplay header file without having relative paths. I was wondering if there was something I am missing for adding in Gem headers files to code outside of the gem WITHOUT using relative paths.
For example, I have an include:
But would rather have something like:
You could alter the waf file to include the Gems folder if not already done, just open the wscript and alter the bld. call and add the gem folder to the includes item.
includes = […,
then you could just use
or you could be less generic and include that gem only in the includes
I added in the gem into the ‘use’ folder which does the ‘pathing’ for you.
ie. use = [‘ChatPlay’]
Thanks for your suggestion!
Provided you have already enabled the Gem in your project, you can just do “#include <GemName/GemNameBus.h>” as stated in the Gem Docs.
In your case it would probably be “#include <ChatPlay/ChatPlayBus.h>”
Accessing Gems in Code
You can access gems through code, as in the following example:
EBUS_EVENT(GemName::GemNameRequestBus, MyFunction, withArgs);