How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?

后端 未结 8 1252
半阙折子戏
半阙折子戏 2020-12-01 12:55

Now mex in MATLAB 2012a only officially supports gcc 4.4.6 but I want to use gcc 4.7 at my own risk. Now If I compile something with mex directly, it will complain that

8条回答
  •  时光取名叫无心
    2020-12-01 13:46

    You can modify ~/.matlab/R2012a/mexopts.sh that generated after doing mex -setup by adding a line in glnx86 section:

    LD_LIBRARY_PATH='/usr/lib:$LD_LIBRARY_PATH'
    

    or in glnx64:

    LD_LIBRARY_PATH='/usr/lib64:$LD_LIBRARY_PATH'
    

提交回复
热议问题