# Screen : &quot;Invalid MEX-file .....&quot;

**URL:** <https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635>\
**Category:** Uncategorized\
**Created:** [September 3, 2018, 9:43pm UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635 "2018-09-03T21:43:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![claire.poullias](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@claire.poullias](https://psychtoolbox.discourse.group/u/claire.poullias)\
**Post date:** [September 3, 2018, 9:43pm UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/1 "2018-09-03T21:43:06Z")

</div>

Hello !

I am trying to run psychotoolbox on Mac OS 10.13.6 and Matlab\_R2017\_b.

When I run&nbsp;SetupPsychtoolbox I get this error :

The returned error message by Matlab/Octave was:

Last Error: Invalid MEX-file '/Applications/Psychtoolbox/PsychBasic/Screen.mexmaci64': dlopen(/Applications/Psychtoolbox/PsychBasic/Screen.mexmaci64, 6): Library not loaded: /Users/matt/Projects/cerbero-1.14/build/dist/darwin\_x86\_64/lib/libffi.7.dylib

&nbsp; Referenced from: /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib

&nbsp; Reason: image not found. (MATLAB:mex:ErrInvalidMEXFile)

&nbsp; &nbsp; /Applications/Psychtoolbox/PsychOneliners/AssertOpenGL.m,99

&nbsp; &nbsp; /Applications/Psychtoolbox/PsychtoolboxPostInstallRoutine.m,613

&nbsp; &nbsp; /Applications/Psychtoolbox/SetupPsychtoolbox.m,262

When I type 'Screen' in the command window I get &nbsp;the same error message.

I tried to disable the System Integrity Protection. I also uninstalled reinstalled Psychotoolbox after . I ran&nbsp;PsychtoolboxVersion after reinstallation and got :

&nbsp; &nbsp; '3.0.14 - Flavor: beta - Corresponds to SVN Revision 8616

&nbsp; &nbsp; &nbsp;For more info visit:

&nbsp; &nbsp; &nbsp;https://github.com/Psychtoolbox-3/Psychtoolbox-3'

  

Did anyone get the same problem and would know how to solve it ?

Best,

Claire

&nbsp;

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 6, 2018, 6:54pm UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/2 "2018-09-06T18:54:05Z")

</div>

Hi Claire,

  

could be you are hitting this GStreamer for macOS bug: [https://bugzilla.gnome.org/show\_bug.cgi?id=796447](https://bugzilla.gnome.org/show_bug.cgi?id=796447)

What version of GStreamer did you install? Does it happen with the latest version 1.14.2? Or the earlier version 1.14.0?

  

It's strange that it would cause load failure at all though, as GStreamer is set up to be an optional component for Screen on macOS. It is supposed to only get loaded when one wants to play movies. Then of course nobody knows if Apple didn't screw up something in the 10.13 linker, i don't have 10.13 for regular testing.

  

mario  

  

  

  

> On Wed, Sep 5, 2018 at 2:00 AM [claire.poullias@...](mailto:claire.poullias@...) [PSYCHTOOLBOX] \<[PSYCHTOOLBOX@yahoogroups.com](mailto:PSYCHTOOLBOX@yahoogroups.com)\> wrote:  
> 
> > Hello !
> > 
> > I am trying to run psychotoolbox on Mac OS 10.13.6 and Matlab\_R2017\_b.
> > 
> > When I run SetupPsychtoolbox I get this error :
> > 
> > The returned error message by Matlab/Octave was:
> > 
> > Last Error: Invalid MEX-file '/Applications/Psychtoolbox/PsychBasic/Screen.mexmaci64': dlopen(/Applications/Psychtoolbox/PsychBasic/Screen.mexmaci64, 6): Library not loaded: /Users/matt/Projects/cerbero-1.14/build/dist/darwin\_x86\_64/lib/libffi.7.dylib
> > 
> > Referenced from: /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstreamer-1.0.0.dylib
> > 
> > Reason: image not found. (MATLAB:mex:ErrInvalidMEXFile)
> > 
> > /Applications/Psychtoolbox/PsychOneliners/AssertOpenGL.m,99
> > 
> > /Applications/Psychtoolbox/PsychtoolboxPostInstallRoutine.m,613
> > 
> > /Applications/Psychtoolbox/SetupPsychtoolbox.m,262
> > 
> > When I type 'Screen' in the command window I get the same error message.
> > 
> > I tried to disable the System Integrity Protection. I also uninstalled reinstalled Psychotoolbox after . I ran PsychtoolboxVersion after reinstallation and got :
> > 
> > '3.0.14 - Flavor: beta - Corresponds to SVN Revision 8616
> > 
> > For more info visit:
> > 
> > [https://github.com/Psychtoolbox-3/Psychtoolbox-3](https://github.com/Psychtoolbox-3/Psychtoolbox-3)'
> > 
> >   
> > 
> > Did anyone get the same problem and would know how to solve it ?
> > 
> > Best,
> > 
> > Claire

---

<div class="post-metadata">

**Author:** ![claire.poullias](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@claire.poullias](https://psychtoolbox.discourse.group/u/claire.poullias)\
**Post date:** [September 9, 2018, 10:02pm UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/3 "2018-09-09T22:02:26Z")

</div>

Hi Mario !
I've installed the &nbsp;1.14.2&nbsp;version. So it should be fixed \>\<.

---

<div class="post-metadata">

**Author:** ![claire.poullias](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@claire.poullias](https://psychtoolbox.discourse.group/u/claire.poullias)\
**Post date:** [September 10, 2018, 9:36am UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/4 "2018-09-10T09:36:35Z")

</div>

I mean the GSstreamer version I had installed before installing Psychtoolbox was the 1.14.2. So, according to them the bug should have been fixed.
  

Best,

  

Claire

---

<div class="post-metadata">

**Author:** ![claire.poullias](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@claire.poullias](https://psychtoolbox.discourse.group/u/claire.poullias)\
**Post date:** [September 20, 2018, 10:50am UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/5 "2018-09-20T10:50:58Z")

</div>

Dear mario,
  

  

when I type&nbsp;type "ls /Library/Frameworks/GStreamer.framework/Libraries/libffi\*" in a terminal window, I &nbsp;get :

  

/Library/Frameworks/GStreamer.framework/Libraries/libffi.7.dylib

/Library/Frameworks/GStreamer.framework/Libraries/libffi.a

/Library/Frameworks/GStreamer.framework/Libraries/libffi.dylib

/Library/Frameworks/GStreamer.framework/Libraries/libffi.la

/Library/Frameworks/GStreamer.framework/Libraries/libffi-3.99999:

include

  

typing&nbsp;&nbsp;"/Library/Frameworks/GStreamer.framework/Commands/gst-inspect-1.0" gives me :

&nbsp;

dyld: Library not loaded: /Users/matt/Projects/cerbero-1.14/build/dist/darwin\_x86\_64/lib/libffi.7.dylib

&nbsp; Referenced from: /Library/Frameworks/GStreamer.framework/Commands/gst-inspect-1.0

&nbsp; Reason: image not found

Abort trap: 6

  

  

I also upgraded to the latest version of GStreamer to see if it changed anything &nbsp;(using Homebrew). Without success unfortunately

  

Best,

  

Claire&nbsp;

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 20, 2018, 1:16pm UTC](https://psychtoolbox.discourse.group/t/screen-quot-invalid-mex-file-quot/635/6 "2018-09-20T13:16:07Z")

</div>

[claire.poullias@...](mailto:claire.poullias@...) [PSYCHTOOLBOX] \<[PSYCHTOOLBOX@yahoogroups.com](mailto:PSYCHTOOLBOX@yahoogroups.com)\> wrote:  

> \> Dear mario,  
> \> when I type type "ls /Library/Frameworks/GStreamer.framework/Libraries/libffi\*" in a terminal window, I get :  
> \>  
> \> /Library/Frameworks/GStreamer.framework/Libraries/libffi.7.dylib  
> \>  
> \> /Library/Frameworks/GStreamer.framework/Libraries/libffi.a  
> \>  
> \> /Library/Frameworks/GStreamer.framework/Libraries/libffi.dylib  
> \>  
> \> /Library/Frameworks/GStreamer.framework/Libraries/libffi.la  
> \>  
> \>  
> \> /Library/Frameworks/GStreamer.framework/Libraries/libffi-3.99999:  
> \>  
> \> include  
> \>  
> \>  
> \> typing "/Library/Frameworks/GStreamer.framework/Commands/gst-inspect-1.0" gives me :  
> \>  
> \>  
> \> dyld: Library not loaded: /Users/matt/Projects/cerbero-1.14/build/dist/darwin\_x86\_64/lib/libffi.7.dylib  
> \>  
> \> Referenced from: /Library/Frameworks/GStreamer.framework/Commands/gst-inspect-1.0  
> \>  
> \> Reason: image not found  
> \>  
> \> Abort trap: 6  
> \>  
> \>  
> \>  
> \> I also upgraded to the latest version of GStreamer to see if it changed anything (using Homebrew). Without success unfortunately  
> \>

This confirms that the library is where it should be, and that this is  
not a Psychtoolbox or Matlab induced problem, as it also happens with  
a basic commandline invocation of GStreamer. Iow. it is a bug in  
GStreamer or a problem with your specific macOS installation.  
  
Strangely there isn't any bug report filed against GStreamer although  
it looks like a bug in the GStreamer 1.14 version. A new bugfix  
release 1.14.3 has been released only a few days ago. I wonder if you  
might have accidentally installed the development package instead of  
the runtime package for end-users or something like that? To make  
sure, delete the current GStreamer installation and then download and  
install exactly the file from the link below and see if anything  
changes:  
  
[https://gstreamer.freedesktop.org/data/pkg/osx/1.14.3/gstreamer-1.0-1.14.3-x86\_64.pkg](https://gstreamer.freedesktop.org/data/pkg/osx/1.14.3/gstreamer-1.0-1.14.3-x86_64.pkg)  
  
Other than that i'd try downloading an older version of GStreamer,  
maybe from the 1.12 series, or the -- rather old by now -- version  
mentioned in "help GStreamer"? If this is not you downloading the  
wrong file or a GStreamer 1.14 bug, it would be some bug/damage to  
your macOS installation for which the most easy fix might be to wipe  
and reinstall macOS.  
  
In general i strongly recommend switching away from macOS for any  
serious data collection, but you certainly know that already.  
-mario
