c-file to mex-file pnet.c in OS 10.9.5 MATLAB 2012a

5 views (last 30 days)
florian schertenleib
florian schertenleib on 6 Jan 2016
System:
OS 10.9.5
MATLAB R2012a
terminal request: gcc --version
Configuredwith: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
AppleLLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Threadmodel: posix
llvm-gcc --version AppleLLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0;
I would like to convert the pnet.c file into a mex-file, see below:
>> mex pnet.c
/Applications/MATLAB_R2012a.app/bin/mex: line 305: gcc-4.2: command not found
mex: pnet.c nota normal file or does not exist.
I'm a beginner and I tried for too long already to find some answer by myself... can anyone help me please?
thanks in advance!

Answers (1)

Walter Roberson
Walter Roberson on 7 Jan 2016
The message is fairly clear: you need to install gcc 4.2 to use that configuration. If it already is installed then you need to create a symbolic link from "gcc-4.2" to the actual software.
4 Comments
Walter Roberson
Walter Roberson on 6 Aug 2020
It looks to me as if you should possibly use
mexpnet.c -lws2_32

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by