MATLAB: System() and library conflict

libraryMATLABsystem

I was trying to load a web page in my system browser using web('url','-browser') and had issues getting it to work with my specified browser
I figured I'd try to just use system() to see if I could get some errors:
system('palemoon http://mimtdocs.rf.gd/manual/html/imstacker.html')
XPCOMGlueLoad error for file /data/homebak/applications/palemoon/libxul.so:
[mymatlabrootdirectory]/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by [myhomedirectory]/applications/palemoon/libxul.so)
Couldn't load XPCOM.
palemoon http://mimtdocs.rf.gd/manual/html/imstacker.html: Signal 127
Of course, I can run this command in a terminal and it works just fine. It seems like the environment difference is causing a conflict with library paths, but I have no idea how I could resolve this either for an explicit system() command, or for the more restricted case where I might want to use web(). Any ideas?
Both methods seem to work fine with other browsers, but PM is the one that is always running. I'd rather not launch a second browser every time I check my own webdocs.
I've observed essentially identical behavior in both R2009b and R2015b

Best Answer

I guess I was thinking too much about how to solve it in Matlab. I just wrote a tiny bash script to deal with it.
#!/bin/bash
unset LD_LIBRARY_PATH OSG_LD_LIBRARY_PATH
palemoon --new-tab $1
Then I just set that as my system browser command. Seems to work, and it hasn't broken anything else yet.