problem with ssc_build to generate custom simscape library

8 views (last 30 days)
Hi everyone, I am trying to learn how to make custom simscape blocks. All I have done is to copy some of the existing ssc files from the simscape library into a new directory (named +MySimscape_lib) that I added to my Matlab path. Then, I run the ssc_build command to generate my custom library. When run the ssc_build command I get the following error message:
Generating Simulink library 'MySimscape_lib' in the MATLAB package parent directory '/users/Gabri KTH/Desktop/GB_Documents/Matlab_myadds' ... /Applications/MATLAB_R2012a.app/bin/mex: line 1022: [: /Users/Gabri: binary operator expected
Error: Could not create TEMP = /users/Gabri KTH/Desktop/GB_Documents/Matlab_myadds/+MySimscape/sscprj
Failed to generate 'MySimscape_lib'
Caused by: Error using mex (line 206) Unable to complete successfully.
Any idea what the problem can be? I have also a problem when I try to modify the source code of the Simscape original blocks. When I run the Simscape simulation that includes the modified block the simulation does not compile and I get this message on the command line:
/Applications/MATLAB_R2012a.app/bin/mex: line 1022: [: /Users/Gabri: binary operator expected /Applications/MATLAB_R2012a.app/bin/mex: line 305: gcc-4.2: command not found /Applications/MATLAB_R2012a.app/bin/mex: line 1326: gcc-4.2: command not found
mex: compile of ' "/private/tmp/tpcf642ac4_9945_468c_9638_a4fe0d665d44.c"' failed.
Are the two problems connected?
Thanks for your help!
Gabriele

Answers (1)

Léo
Léo on 4 Oct 2014
Hi, Have you a compiler installed on your computer? Try to run the command "mex -setup", it could be the problem if you use a 64-bit version

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!