Mex compiling on 64 bit linux - /usr/bin/ld: cannot find -lstdc++

前端 未结 5 1736
暖寄归人
暖寄归人 2021-01-27 03:01

Okay I am trying to compile a mex file on 64 bit linux, ubuntu to be precise with Matlab 2013a.

First it gave a error that it could not find GLIBCXX_3.4.15

5条回答
  •  迷失自我
    2021-01-27 03:48

    Look at this line gcc -O -pthread -shared -Wl,--version-script,/usr/local/MATLAB/R2013a/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "tload3.mexa64" tload3.o -Wl,-rpath-link,/usr/local/MATLAB/R2013a/bin/glnxa64 -L/usr/local/MATLAB/R2013a/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++.

    The options with L are the places where gcc/the linker looks for libraries. Id sugest trying to put the symlink in /usr/local/MATLAB/R2013a/bin/glnxa64 ( libstdc++.so.6 is there in 2012a), and start matlab from a terminal, it spits some errors there. Or add the new folder as a CLIB argument.

    And I also would delete the -ansi part for c ( replace it with -std=c99), so that it won't give you errors on using \ style comments in your c code.

提交回复
热议问题