Important: Please read the Qt Code of Conduct -

GUI in shared library can't find find or load the Qt platform plugin "cocoa"

  • I have a shared library (.dylib) which contains a function with

    int argc = 0;
    QApplication app(argc, NULL);
    QWidget widget;
    widget.resize(100, 100);;

    I load the shared library in .NET and call the function:

    static class AuthDialog{
        public static extern void ShowAuthDialog();

    But when I run the application I get this error:
    This application failed to start because it could not find or load the Qt platform plugin "cocoa".

    Can someone tell me how can I get this working?

    Note: The .dylib is loaded correctly, because anything I print before the QApplication gets printed correctly.

Log in to reply