2.6 Compiling plugins

All source files that include hollywood/plugin.h need to be compiled with certain preprocessor commands defined, depending on the platform. Here is a list of preprocessor commands that may need to be defined, depending on your platform:

HW_AMIGAOS3
Needs to be defined for AmigaOS 3 builds.

HW_AMIGAOS4
Needs to be defined for AmigaOS 4 builds.

HW_ANDROID
Needs to be defined for Android builds.

HW_AROS
Needs to be defined for AROS builds.

HW_LINUX
Needs to be defined for Linux builds.

HW_LITTLE_ENDIAN
Needs to be defined for little endian builds.

HW_MACOS
Needs to be defined for macOS builds.

HW_MORPHOS
Needs to be defined for MorphOS builds.

HW_WARPOS
Needs to be defined for WarpOS builds.

HW_WIN32
Needs to be defined for Windows builds.

Also make sure to use the HW_EXPORT macro on all function declarations that you export as shared library functions to Hollywood, i.e.

 
HW_EXPORT int InitPlugin(hwPluginBase *self, hwPluginAPI *cl, STRPTR p)
{
    ...
}

Finally, don't forget to target your plugin for the right architecture. The 32-bit version of Hollywood can only load plugins compiled for a 32-bit architecture whereas the 64-bit version can only load plugins compiled for 64-bit. Modern compilers often default to 64-bit binaries nowadays so keep in mind that these binaries can't be loaded by the 32-bit versions of Hollywood. To make it easier for you to distinguish between 32-bit and 64-bit builds, the Hollywood SDK will automatically define the HW_64BIT preprocessor constant when it has detected that you are building for a 64-bit target.

On AmigaOS you also need to make sure that you do not link the compiler's startup code against the plugin as this can cause conflicts. You also must not use any library auto-open features provided by the compiler. You need to manually open all Amiga libraries that your plugin requires. See AmigaOS C runtime limitations for details.


Show TOC