SimulinkS-FunctionにパックしたいC++ルーチンがあります。このC++ルーチンは、他のいくつかのC++ファイルにある他のルーチンを呼び出します。
私はlegacy_codeツールを使用してすべてをコンパイルすることができました(つまり、mexglxファイルが生成されます)。ただし、次の警告が発行されます。
Warning: You are using gcc version "4.4.4-14ubuntu5)". The earliest gcc version
supported with mex is "4.1". The latest version tested for use with mex
is "4.2". To download a different version of gcc, visit http://gcc.gnu.org
次のコマンドを発行してS-Functionブロックを生成しようとすると、問題が発生します。
legacy_code('slblock_generate', def);
この時点で、GLIBCXXバージョンに言及する次のエラーが発生します。
??? Error using ==> iAddSfunctionBlock at 183
Error due to multiple causes.
Error in ==>
/opt/matlab/toolbox/simulink/simulink/+legacycode/@LCT/generateslblock.p>
generateslblock at 55
Error in ==> /opt/matlab/toolbox/simulink/simulink/legacy_code.p>legacy_code at
160
Caused by:
Error using ==> iAddSfunctionBlock at 183
Invalid MEX-file 'sfun_vectorRotation_b.mexglx':
/opt/matlab/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version
`GLIBCXX_3.4.11' not found (required by sfun_vectorRotation_b.mexglx).
Error using ==> iAddSfunctionBlock at 183
Error while obtaining sizes from MEX S-function 'sfun_vectorRotation_b' in
'untitled1/sfun_vectorRotation_b'. MATLAB error message:
Invalid MEX-file 'sfun_vectorRotation_b.mexglx':
/opt/matlab/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version
`GLIBCXX_3.4.11' not found (required by sfun_vectorRotation_b.mexglx).
正直なところ、私はこの時点で少し迷っています。g ++コンパイラをダウングレードするだけで十分かどうか、または他のことをしなければならないかどうかはわかりません。この問題の可能な解決策はありますか?
Ubuntu 10.10OSでMatlab2009bを使用していますが、g++のバージョンは次のとおりです。
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
よろしくお願いします
ミケル