Skip to content

Commit 17c8990

Browse files
committed
Add more helpful error message in case liblsl.so/dll/dylib isn't found
1 parent 1fd8183 commit 17c8990

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lsl_loadlib.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@
6262
error(['Apparently the file "' dllpath '" is missing on your computer. Cannot load the lab streaming layer.']); end
6363

6464
% open the library and make sure that it gets auto-deleted when the handle is erased
65-
hlib = lsl_loadlib_(dllpath);
65+
try
66+
hlib = lsl_loadlib_(dllpath);
67+
catch e
68+
disp('See https://github.com/labstreaminglayer/liblsl-Matlab/#troubleshooting for troubleshooting tips');
69+
error(['Error loading the liblsl library: ', e.message]);
70+
end
71+
6672
hlib.on_cleanup = onCleanup(@()lsl_freelib_(hlib));
6773

6874
if keep_persistent
6975
lib = hlib; end
70-
end
76+
end

0 commit comments

Comments
 (0)