Plugin include custom header file

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
Grue
Private First Class
Private First Class
Posts: 14
Joined: Tue Apr 08, 2014 12:23 am

Plugin include custom header file

Post by Grue »

Hey all,

So I've been trying to use allejo's really handy plugin, the bztoolkit, which can be found here: https://github.com/allejo/bztoolkit

I've been having a few issues with getting it working, and I think it stems from some misunderstanding I have with referencing .h files.

In allejo's documentation, they say to use the plugin by #include bztoolkit/bzToolkitAPI.h. However, this does not work, and I instead have to do the entire file extension: /home/usr/Documents//bzflag/plugins/bztoolkit/bzToolkitAPI.h. Is this normal? Because I don't have to do the same when including "bzfsAPI.h", "plugin_utils.h", or any of the built-in ones.

Anyway, this *does* compile, however when attempting to start the sever, it says that my plugin cannot be loaded. I'm guessing this is due to including bzToolkitAPI.h, because as soon as I remove the #include, everything works.

Any idea how to fix this? Sorry if this question is a little muddled.

Thanks,
Grue
GEP
Private First Class
Private First Class
Posts: 9
Joined: Sun Jan 12, 2020 7:17 pm

Re: Plugin include custom header file

Post by GEP »

From what I've learned working with other plugins that use bztoolkit, its supposed to be in a sub directory of the plugin that uses it.
For example `bzflag/plugins/sample_plugin/bztoolkit...` and then you use `#include bztoolkit/bzToolKitAPI.h` inside sample_plugin.cpp.

I don't know how it could be used across plugin folders, perhaps try `#include bzToolKitAPI.h` without the path before it.
Hope that's of some help.
User avatar
blast
General
General
Posts: 4874
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Plugin include custom header file

Post by blast »

bztoolkit is archived and was last updated in 2017. It also bypasses the API, which may be why you're having problems. The reason we have an API is to expose a (somewhat) stable interface. When you bypass the API, there's almost a guarantee we'll break something on you eventually.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply