FyroxEngine/Fyrox · error

Unsupported platform!

Error message

Unsupported platform!

What it means

DynamicPlugin::load only supports dynamic library loading on unix and windows; on any other target platform the cfg-guarded branch panics with "Unsupported platform!". The dylib plugin system is simply not implemented elsewhere.

Solutions

  1. Disable the dylib/plugin-dylib feature and use statically linked plugins on unsupported platforms
  2. Target only unix or windows when using dynamic plugins
  3. Guard plugin loading code with #[cfg(any(unix, windows))]

Example fix

// before
let plugin = DynamicPlugin::load(path, user_data, true)?;
// after
#[cfg(any(unix, windows))]
let plugin = DynamicPlugin::load(path, user_data, true)?;
#[cfg(not(any(unix, windows)))]
let plugin = create_static_plugin()?;
Defensive patterns

Strategy: validation

Validate before calling

#[cfg(not(any(unix, windows)))]
compile_error!("DynamicPlugin requires unix or windows");

Try / catch

let plugin = std::panic::catch_unwind(|| DynamicPlugin::load(...)).ok();

Prevention

When it happens

Trigger: Calling DynamicPlugin::load on a platform that is neither unix nor windows (e.g. wasm, android non-libdl targets) with the dylib feature enabled.

Common situations: Compiling a Fyrox game with plugin hot-reloading for wasm/web or embedded targets; cross-compiling to unsupported platforms.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/fdfccca93407e79a. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-impl/src/plugin/dylib.rs:78

        P: libloading::AsFilename,
    {
        #[cfg(any(unix, windows))]
        unsafe {
            let lib = libloading::Library::new(path).map_err(|e| e.to_string())?;

            let entry = lib
                .get::<PluginEntryPoint>("fyrox_plugin".as_bytes())
                .map_err(|e| e.to_string())?;

            Ok(Self {
                plugin: entry(),
                lib,
            })
        }

        #[cfg(not(any(unix, windows)))]
        {
            panic!("Unsupported platform!")
        }
    }

    /// Return a reference to the plugin interface of the dynamic plugin.
    pub fn plugin(&self) -> &dyn Plugin {
        &*self.plugin
    }

    /// Return a reference to the plugin interface of the dynamic plugin.
    pub(crate) fn plugin_mut(&mut self) -> &mut dyn Plugin {
        &mut *self.plugin
    }
}

/// Implementation of DynamicPluginTrait that (re)loads Rust code from Rust dylib .
pub struct DyLibDynamicPlugin {
    /// Dynamic plugin state.
    state: PluginState,

View on GitHub (pinned to 76c91aad8e)