Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Cannot compile "matlab function block" in linux
Replies: 2   Last Post: Jan 22, 2013 5:14 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Frank Engels

Posts: 6
Registered: 10/6/10
Cannot compile "matlab function block" in linux
Posted: Jan 18, 2013 2:43 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have an Simulink model in which I use a matlbab function block.
The block contains a simple calulation:
function power= fcn(espd,calLoad,maxTorque)
%#codegen
power = espd*calLoad*pi/60*maxTorque/100000*3600;

When I build the code an genereate it I get the following error:
Making simulation target "OBDFuelEstimator_sfun", ...


/usr/local/MATLAB/R2011b/bin/mex -c -O -DMATLAB_MEX_FILE -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../simulink/include -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../extern/include -I/usr/local/MATLAB/R2011b/stateflow/c/mex/include -I/usr/local/MATLAB/R2011b/stateflow/c/debugger/include OBDFuelEstimator_sfun.c

Warning: You are using gcc version "4.6.3-1ubuntu5)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/

/usr/local/MATLAB/R2011b/bin/mex -c -O -DMATLAB_MEX_FILE -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../simulink/include -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../extern/include -I/usr/local/MATLAB/R2011b/stateflow/c/mex/include -I/usr/local/MATLAB/R2011b/stateflow/c/debugger/include OBDFuelEstimator_sfun_registry.c

Warning: You are using gcc version "4.6.3-1ubuntu5)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/

/usr/local/MATLAB/R2011b/bin/mex -c -O -DMATLAB_MEX_FILE -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../simulink/include -I/usr/local/MATLAB/R2011b/toolbox/stateflow/stateflow/../../../extern/include -I/usr/local/MATLAB/R2011b/stateflow/c/mex/include -I/usr/local/MATLAB/R2011b/stateflow/c/debugger/include c2_OBDFuelEstimator.c

Warning: You are using gcc version "4.6.3-1ubuntu5)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/


/usr/local/MATLAB/R2011b/bin/mex -silent LDFLAGS="\$LDFLAGS " -output OBDFuelEstimator_sfun.mexglx OBDFuelEstimator_sfun.o OBDFuelEstimator_sfun_registry.o c2_OBDFuelEstimator.o /usr/local/MATLAB/R2011b/stateflow/c/mex/lib/glnx86/sfc_mex.a /usr/local/MATLAB/R2011b/stateflow/c/debugger/lib/glnx86/sfc_debug.a -L/usr/local/MATLAB/R2011b/bin/glnx86 -lfixedpoint -lut -lmwmathutil -lemlrt -lmwblascompat32 -L/usr/local/MATLAB/R2011b/bin/glnx86 -lippmwipt

Warning: You are using gcc version "4.6.3-1ubuntu5)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/

/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

mex: link of ' "OBDFuelEstimator_sfun.mexglx"' failed.

gmake: *** [OBDFuelEstimator_sfun.mexglx] Error 1



### Build procedure for model: 'OBDFuelEstimator' aborted due to an error.

When I remove the matlab function block no error occurs and the compilation works fine.

Does anybody has a solution for thsi problem, I am using R2011b



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.