labstreaminglayer / liblsl-Matlab

Matlab bindings for liblsl
MIT License
36 stars 13 forks source link

Undefined function 'lsl_loadlib_' for input arguments of type 'char'. #9

Closed mgmussi closed 4 years ago

mgmussi commented 4 years ago

Hello,

I'm trying to install the LSL lib, but I'm running through this error when I try to execute the ReceiveData.m example:

Error loading the liblsl library: Undefined function 'lsl_loadlib_' for input arguments of type 'char'.

Did I get anything wrong? I followed the instructions from your installation. I'm currently using a Windows 7 64 bit, a MatLab R2019b and the liblsl 1.13.14 (latest version so far).

It's also interesting to note that when I just had it installed, it was working just fine, but after I tried to print some data from my OpenBCI LSL a couple of times, it crashed and I can't find an answer for this error.

Let me know if you need any further information.

dmedine commented 4 years ago

It could be that the binaries on the release pages don't work with Matlab 2019. I have just uploaded a build from my computer. The only difference that I see is that I use Windows 10, so it is possible that it still won't work.

If you have one of the msvc installers installed on your system, it is fairly easy to build the mex files yourself. There is a script called build_mex that works quite well (provided you have your system configured correctly).

Unfortunately maintaining a comprehensive set of binaries for the Matlab wrapper is nigh-on impossible. I tried to convince Mathworks to do it for us at SfN this year, but they had no interest in it and I don't blame them. Too many combinations of OSs and Matlab versions.

cboulay commented 4 years ago

I've added more helpful error messages, including instructions to add the bin folder to the path and try running build_mex.