1

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.

İsmail Y.
  • 3,579
  • 5
  • 21
  • 29
acsarda
  • 11
  • 1
  • 2
  • My experiences is that generally, the newer gcc's work with MATLAB mex, so unless the mex file does not work, ignore the warning. Also, you must have a very, very old version of MATLAB, as the current one supports 9.x.x – Ander Biguri Aug 17 '21 at 10:53

1 Answers1

4
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
SherlockS
  • 41
  • 1
  • I get the following error: `W: GPG error: http://dk.archive.ubuntu.com/ubuntu xenial InRelease: The following signatures couldn't be veri fied because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32` `E: The repository 'http://dk.archive.ubuntu.com/ubuntu xenial InRelease' is not signed.` `N: Updating from such a repository can't be done securely, and is therefore disabled by default.` `N: See apt-secure(8) manpage for repository creation and user configuration details.` How can I make it signed? – Ethan Posner Mar 12 '23 at 23:39