[SOLVED] Problem creating mex files in Matlab 7.8.0

Issues related to software problems.
Post Reply
mebden
Posts: 2
Joined: 2011/09/02 07:18:31
Contact:

[SOLVED] Problem creating mex files in Matlab 7.8.0

Post by mebden » 2011/09/02 07:29:36

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Problem creating mex files in Matlab 7.8.0

Post by TrevorH » 2011/09/02 09:44:11

Do you have the package libstdc++-devel installed?

mebden
Posts: 2
Joined: 2011/09/02 07:18:31
Contact:

Re: Problem creating mex files in Matlab 7.8.0

Post by mebden » 2011/09/02 15:19:54

Hi,

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

Cheers,

Mark

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] Problem creating mex files in Matlab 7.8.0

Post by pschaff » 2011/09/17 13:51:37

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.

Post Reply