title: Dart FFI fails loading dynamic library in MacOS
body: <p>I am trying to build flutter desktop application in <strong>MacOS</strong> and trying call <strong>C++</strong> code using <strong>dart FFI</strong>. I have used this GitHub project as template and change some source code to call <strong>C++</strong> library. I am able to run this project if I do not use <strong>FFI</strong>.</p>
  
  <p><a href="https://github.com/google/flutter-desktop-embedding" rel="nofollow noreferrer">https://github.com/google/flutter-desktop-embedding</a></p>
  
  <p><strong>ERROR :</strong></p>
  
  <blockquote>
    <p>flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
    flutter: The following ArgumentError was thrown building MyHomePage(dirty, state: _MyHomePageState#86c2f):
    flutter: Invalid argument(s): Failed to load dynamic library (dlopen(/usr/lib/structs.dylib, 1): image not
    flutter: found)
    flutter:
    flutter: The relevant error-causing widget was:
    flutter: MyHomePage
    flutter: file:///Users/rmazumder/VisualCode-Workspace/flutter-desktop-embedding-master/example/lib/main.dart:39:13
    flutter:
    flutter: When the exception was thrown, this was the stack:</p>
  </blockquote>
  
  <p><strong>My Flutter and Dart version:</strong></p>
  
  <pre><code>rmazumder$ flutter --version
  Flutter 1.12.15-pre.12 • channel master • 
  https://github.com/flutter/flutter.git
  Framework • revision b2a36ffcd2 (22 hours ago) • 2019-11-26 11:45:51 -0500
  Engine • revision e136d637a8
  Tools • Dart 2.7.0
  </code></pre>