Hi Sid,
There are chances that you are not using a third party supported compiler. The compiler could be working for R2010b but may be not for R2014a. You can check the list of supported compilers for R2014a here:
Make sure you have one of these installed.
If the compiler seems to be fine, provide the error message you are receiving and also the complete command you are trying to execute.
You can also use the "deploytool" to compile the MATLAB code into C++ shared library:
1. Enter "deploytool" on your MATLAB command window.
2. In the "Add Exported Function", add the .m file
3. Select "C++ shared library" option form the list to the left of "Add Exported Function"
4. Add any other files needed in the "Files required for your application to run" section.
4. Click "Package"
This will create 3 subfolders within the folder named as your .m file. The DLL will be present in the folder "for_redistribution_files_only" and "for_testing"