LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "invalid mex-file..." please help! (http://www.linuxquestions.org/questions/linux-newbie-8/invalid-mex-file-please-help-746346/)

billzhao 08-10-2009 01:00 AM

"invalid mex-file..." please help!
 
Dear all,

I am new in linux environment.

I have installed matlab R14 in Ubuntu 9.0.4. And I understand that R14 was compiled in gcc 3.2.3 and the gcc version installed in Ubuntu 9.0.4 is gcc 4.3.3.

I compiled a few c files in matlab using "mex" and obtained a list of mexglx files. But when I try to use the methods, the below error occurred:

"??? Invalid MEX-file '/media/Data/Projects/sift/siftmatch.mexglx': /media/WinXP/matlab_unix/bin/glnx86/../../sys/os/glnx86/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)."

Could anybody suggests how to solve the problem? I find it quite troublesome to re-install another gcc version in my system. And can the problem be solved by using LD_LIBRARY_PATH parameter?

Thank you very much!!

billzhao 08-10-2009 07:47 AM

Hi Linux gurus, please do help me on this! Thanks a LOT!
 
Hi Linux gurus, please do help me on this! Thanks a LOT!

Quote:

Originally Posted by billzhao (Post 3637327)
Dear all,

I am new in linux environment.

I have installed matlab R14 in Ubuntu 9.0.4. And I understand that R14 was compiled in gcc 3.2.3 and the gcc version installed in Ubuntu 9.0.4 is gcc 4.3.3.

I compiled a few c files in matlab using "mex" and obtained a list of mexglx files. But when I try to use the methods, the below error occurred:

"??? Invalid MEX-file '/media/Data/Projects/sift/siftmatch.mexglx': /media/WinXP/matlab_unix/bin/glnx86/../../sys/os/glnx86/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)."

Could anybody suggests how to solve the problem? I find it quite troublesome to re-install another gcc version in my system. And can the problem be solved by using LD_LIBRARY_PATH parameter?

Thank you very much!!


jdkaye 08-10-2009 08:05 AM

I really can't help you never having used matlab but isn't the compiler looking for gcc 4.2.0? It doesn't seem interested in version 3.2.3.
jdk

knudfl 08-10-2009 08:08 AM

Welcome to LQ.

sudo apt-get install gcc-4.2 gcc-3.4 g++-4.2

... will get you some. The colllection is limited on 9.04,
if you need more compilers, please try out 8.04 packages.
Example link : http://packages.ubuntu.com/hardy-updates/g++-3.3

And no problem having e.g. four different compilers :
Example :
./configure CC=gcc-4.2 CXX=g++-4.2
and / or : make CC=gcc-3.4 CXX=g++-3.4
.....

billzhao 08-10-2009 09:28 PM

reply
 
hey knudfl,

Thanks a lot for your help!

And I would like to clarify: Do you mean that I install another version of gcc? and it seems that the system already has gcc-3.4:

gcc-3.4 is already the newest version.
The following packages were automatically installed and are no longer required:
libtwolame0 libmad0 libmpeg2-4 liba52-0.7.4

Quote:

Originally Posted by knudfl (Post 3637782)
Welcome to LQ.

sudo apt-get install gcc-4.2 gcc-3.4 g++-4.2

... will get you some. The colllection is limited on 9.04,
if you need more compilers, please try out 8.04 packages.
Example link : http://packages.ubuntu.com/hardy-updates/g++-3.3

And no problem having e.g. four different compilers :
Example :
./configure CC=gcc-4.2 CXX=g++-4.2
and / or : make CC=gcc-3.4 CXX=g++-3.4
.....


jdkaye 08-10-2009 10:23 PM

Quote:

Originally Posted by billzhao (Post 3638628)
hey knudfl,

Thanks a lot for your help!

And I would like to clarify: Do you mean that I install another version of gcc? and it seems that the system already has gcc-3.4:

gcc-3.4 is already the newest version.
The following packages were automatically installed and are no longer required:
libtwolame0 libmad0 libmpeg2-4 liba52-0.7.4

Yes, you can. Try installing gcc-4.2 as knudfl suggested
Cheers
jdk


All times are GMT -5. The time now is 09:23 PM.