I am attempting to make a Hello-World Raspberry Plugin just to get me started and can’t seem to have Xojo 2022 r4.1 to recognize the plugin. Does anyone have suggestions as to what I may be doing wrong?
Here are some of my presumptions:
- Create a 64-bit plugin on Ubuntu Linux (Xojo is 64-bit, so I am using a 64-bit version).
- The Raspberry Pi 4B is a 32-bit operating system (making functions/pointers 32-bit compatible)
- The plugin (LibGPIODPlugin.so) does not load, and shows the following error in the Xojo IDE
LibGPIODPlugin.so (Could not open plugin format)
- The plugin should allow typing of code with a RPiSS. prefix
Here are the compiler commands:
- gcc -c LibGPIODPlugin.c -o LibGPIODPlugin.o //builds an .o file from the c source
- ar rcs LibGPIOPlugin.a LibGPIODPlugin.o //builds an a file
- gcc -shared LibGPIODPlugin.o -o LibGPIODPlugin.so //creates the .so library
Here is my C code:
#include </home/eugenedakin/Desktop/Plugin/Includes/LinuxHeader.h>
#include </home/eugenedakin/Desktop/Plugin/Includes/REALplugin.h>
#include </home/eugenedakin/Desktop/Plugin/Includes/rb_plugin_deprecated.h>
//#include </home/eugenedakin/Desktop/Plugin/GlueCode/PluginMain.cpp>
#include <stdio.h>
#include <string.h>
//Forward Declarations
static REALstring VERSIONSS(void);
REALmethodDefinition RPiXojoModuleMethods[] = {
{(REALproc)VERSIONSS, REALnoImplementation, "Version() as String", REALconsoleSafe},
};
REALconstant RPiXojoModuleConstants[] = {
{ "Pi = 3.141592653589793238" },
{ "Pi_VERSION = 4"},
};
REALmoduleDefinition RPiXojodefn = {
kCurrentREALControlVersion,
"RPiSS", //Name of module shown to user
RPiXojoModuleMethods, // Method names
sizeof(RPiXojoModuleMethods) / sizeof(REALmethodDefinition), //Method Size
RPiXojoModuleConstants, //Constant names
sizeof(RPiXojoModuleConstants) / sizeof(REALconstant), //Constant Size
nil, //eProperties,
0, //Property count
nil, //Structures,
0, //Structure count
nil, //REALenum *enums;
0, //size_t enumCount;
nil, //REALattribute *attributes;
0, //size_t attributeCount;
nil, //REALdelegate *delegates;
0, //size_t delegateCount; REALBuildStringWithEncoding
nil, //REALclassDefinition **classes;
0, //size_t classes count
nil, //REALinterfaceDefinition *interfaces;// Assumes this module’s namespace
0, //size_t interfaceCount;
nil, //struct REALmoduleDefinition **modules;// Assumes this module’s namespace
0, //size_t moduleCount;
nil, //REALcontrol **controls; // Assumes this module’s namespace
0, //size_t controlCount;
};
static REALstring VERSIONSS(void)
{ //std::string VERSION_MAJOR = "1";
//std::string VERSION_MINOR = "0";
//std::string VERSION_PATCH = "0";
//std::string VERSION_BUILD = "0";
//GUID:E04F9180-6183-4B55-8C4A-1BD2B1E2470A
//Reminder - update Version.info in main plugin folder
const char* VerString = "Plugin:RPiXojoPlugin \nVersion:1.0.0.0 \nAuthor:Eugene Dakin\n GUID:E04F9180-6183-4B55-8C4A-1BD2B1E2470A\n";
return REALBuildStringWithEncoding(VerString, strlen(VerString), kREALTextEncodingASCII);
}
Thanks for your help