Starting a new Plugin

Hi,

We are currently starting work on a new plugin for a project we’re doing, and I’m having trouble getting this to work. I downloaded Xcode 9.4 so that I can build i386 and x86-64 for the Mac, but the example CompleteClass plugin seems to require the Carbon framework and related headers and these (the headers at least) do not exist on my current Mac from what I can tell. Is there anything I’m missing about this? Should I be stripping references to Carbon since I’m not building anything that has UI functionality? Any assistance here is greatly appreciated. Currently compilation error is:

/Applications/Xojo 2017 Release 3/Extras/PluginsSDK/Includes/REALplugin.h:16:11: ‘Carbon/Carbon.h’ file not found

Thanks,
Mike

Start with a MUCH newer version like the ones from 2019r1 or 2019r1.1 which should build with Xcode 9 and 10
William and I went through and updated them in 2018 or so

Okay, I’ll give that a shot. Will that be compatible with 2017 release 3 too?

cant say I can think of anything specific in there that would make it NOT be BUT I dont think the default plugin set up is configured to generate a 32 bit and 64 bit plugin
its been a while since I look at that

Okay, thanks Norman. I’ll give that shot.

Just pulled down 2019r1.1 and built the complete class and now it’s not loading. I’m seeing the following error in the macOS console:

default 10:41:26.626463 -0400 Xojo [XOJO] Unable to load plugin CompleteClass.xojo_plugin

Any way to get detailed error messages from Xojo to see why?

And to clarify, I’ve built the dylib both as x86-64 and i386:

Mac x86-64
CompleteClass.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Mac Cocoa
CompleteClass.dylib: Mach-O dynamically linked shared library i386

Is it packaged as a plugin ?
see the Plugin Packaging.rtf in Extras > Plugin SDK

Structure is as follows:

[code]CompleteClass.xojo_plugin

  • ---- Build Resources
    + ---- Mac Cocoa
    + ---- CompleteClass.dylib
    + ---- Mac x86-64
    + ---- CompleteClass.dylib[/code]

Anything else I would need to do?

and its all zipped up which is all a plugin is (a zip file with the xojo_plugin extension)

I’ll assume you’re trying this on macOS ?
Does it load in 2019r1.1 ?
If so but it doesnt load in 2017 I honestly dunno what else might be wrong as the plugin format change _should_be usable in 2017
I think that change was before then

Hm, so it seems to work after it’s zipped - I thought you could have just a folder zipped up for testing purposes?

I think unzipped they need to be in “Debug Plugins”

If I remember correctly. the IDE also loads unzipped plugins, if the folder has right extension.

Yeah a folder works fine. The Debug Plugins thing must be new since I last worked on our plugin, a few months ago this wasn’t required. We just had folders with the correct name in the Plugins directory and it worked fine.

I just tested this and it did not work. I wanted to improve IDE loading time by pre-decompressing everything, but only the zipped plugins loaded.

We looked into why this was on the Discord channel, and it turns out double-clicking to unzip the plugin makes it one folder too flat.

The instructions are this for unzipping in Finder:

  1. Rename Plugin.xojo_plugin to Plugin.zip
  2. Double-click to unzip
  3. Put the contents inside a folder called Plugin.xojo_plugin
  4. Put that (not what came out of the zip) into Plugins

[quote=455700:@Tim Parnell]We looked into why this was on the Discord channel, and it turns out double-clicking to unzip the plugin makes it one folder too flat.

The instructions are this for unzipping in Finder:

  1. Rename Plugin.xojo_plugin to Plugin.zip
  2. Double-click to unzip
  3. Put the contents inside a folder called Plugin.xojo_plugin
  4. Put that (not what came out of the zip) into Plugins[/quote]
    Interesting process. Did you notice an improvement in load times? I have a rather complex math plugin that takes longer that the MBS Chart plugin to load. I’ll try this on my side and report back my specific findings.

The answer to that question is that the trade-off is not worth the non-zip move for me.

The IDE loads the plugins around 40% faster, but the compile timer of the plugins in the even of a Plugins folder content change is FAR longer than normal.

In the event of my math plugin, the load time goes from 7 seconds to around 4.2, but the initial recompile of the plugin for the three platforms goes from 21 seconds to over 72 seconds. Doing the test with all of my MBS and Einhugur plugins shows a similar growth factor on the initial compile (I finished a cup of coffee).

So, this one gets a “only do that if you’re more concerned about IDE launch times” score.

You’re saying it takes 3x longer to build from an expanded zip?

Compiling (preparing) the plugins, not your app - that time remained constant.