Page 1 of 1

[SOLVED] Problem creating mex files in Matlab 7.8.0

Posted: 2011/09/02 07:29:36
by mebden
Hi,

Running Matlab 7.8.0 on CentOS 5.5, I'd like to start mexing .c files. My gcc works fine (version 4.1.2 20080704). I followed the standard instructions:
http://www.mathworks.co.uk/support/tech-notes/1600/1605.html#example1

But I get an error at the Matlab prompt, which may or may not indicate that Matlab is having trouble finding the C compiler:

-------------------------------------------------
>> mex hello.c
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

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

??? Error using ==> mex at 218
Unable to complete successfully.
-------------------------------------------------

I'm relatively bad with Linux commands, but hopefully there is something that could fix this in one or two specific lines at the CentOS prompt? Thanks for your help.

Cheers,

Mark

Re: Problem creating mex files in Matlab 7.8.0

Posted: 2011/09/02 09:44:11
by TrevorH
Do you have the package libstdc++-devel installed?

Re: Problem creating mex files in Matlab 7.8.0

Posted: 2011/09/02 15:19:54
by mebden
Hi,

Thanks, I don't know if it was there already but I typed 'yum install libstdc++-devel'. Now it works! Thanks.

Cheers,

Mark

[SOLVED] Problem creating mex files in Matlab 7.8.0

Posted: 2011/09/17 13:51:37
by pschaff
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Thanks for reporting back. Marking this thread [SOLVED] for posterity.