I need to install gcc4.9 on ubuntu 20.04 | matlab mex

4.2k Views Asked by At

On matlab, I was trying to run mex file.c but I got a warning and error message. Anyway, I think the problem is what the warning says:

Warning: You are using gcc version '9.3.0'. The version of gcc is not supported. The version currently supported with MEX is '4.9.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release

.

Then, I tried to install gcc-4.9: sudo apt-get install gcc-4.9 but there is no package candidate.

1

There are 1 best solutions below

2
SherlockS On
cd /etc/apt or 
sudo vim /etc/apt/sources.list

append this to sources.list:

deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe

then

sudo apt update
sudo apt-get install gcc-4.9