Jump to content

X-Plane Plugins Directory structure

Recommended Posts

Good day everyone,

I scrolled diagonaly through the SDK texts found on the x-plane sdk site. I admit I am not finished reading that, however, I would need help understanding how a plugin' development, from a Visual Studio directory/file structure, goes (or is migrated to) the X-Plane directory.

It seems that the code samples are not compiling properly and Visual Studio is at a loss to locate files, that seem not to be where they should be, or refuses to start win.xpl, which I don't think it should even try at all, but yeah.

Does anybody as a comprehensive explanation of how that works?

Thanks !

  • Like 1

Share this post

Link to post
Share on other sites

Slowly, these questions are being answered by further reading and video watching. Don't mind me...Nothing to see here...LOL

Share this post

Link to post
Share on other sites

Hi Anne,

glad to see more C++ developers here on Threshold!

The directory structure of X-Plane plugins is a little confusing because there are several different approaches that evolved with different X-Plane versions. Since you are using Visual Studio, the starting point of the plugin deployment should be the DLL file generated by the Visual Studio compiler, let's assume it's called plugin.dll. Now there are different approaches of what you can do to get the plugin into X-Plane, here are three common ones:

  • rename plugin.dll to anything you'd like but replace the file extension with "xpl" and put it into the X-Plane/Resources/plugins directory (and not into a subdirectory!). For example, rename it to annes_plugin.xpl and put it right into the plugin directory. This approach will only work if you develop for one platform (e.g. Windows) only and if your plugin doesn't require any external files like images. This is the oldest but easiest approach. The official name of this approach is "thin plugin".
  • if you need external files for your plugin or want to support more than one platform than Windows, you will need a so-called fat plugin. These are plugins that have their own subdirectory inside the X-Plane/Resources/plugins directory along with a directory called "64" inside your plugin directory. To create a fat plugin, create a subdirectory with your plugin name inside the "plugins" directory and rename plugin.dll to win.xpl. Example: X-Plane/resouces/plugins/AnnesPlugin/64/win.xpl. External files go into the main directory of the plugin. If you ever want to support Linux or OS X, there will be additional files called lin.xpl and mac.xpl in the "64" directory.
  • the previous approach has the disadvantage that every plugin is called "win.xpl" in crash dumps and other diagnostic tools. So the state-of-the-art approach is to create a directory called "win_x64" inside your plugin directory and call the XPL file exactly the same name as the main plugin folder. Example: X-Plane/Resources/plugins/AnnesPlugin/win_x64/AnnesPlugin.xpl

I use the third approach for the plugins I develop (AviTab, MoveVR and SAM). That approach is sometimes confusing for users because they can no longer rename a plugin directory for testing purposes because they would have to rename the XPL file as well and are not aware of that.

All approaches are explained in more detail here: https://developer.x-plane.com/article/building-and-installing-plugins/

Please don't hesitate to ask further questions, I really want to see more C++ developers on board and will try my best to help them!

  • Like 2

Share this post

Link to post
Share on other sites
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • To be able to comment, start new topics, download files or get access to certain parts of the forum you will have to be Signed in.

    Sign up to participate

  • Current Donation Goals

  • Threshold News

  • Threshold articles

  • Threshold clubs


Important Information

Please read the Terms of Use