0

I tried to use the header "gurobi_c++.h" to make an optimization using Gurobi Solver in Matlab but all time I get the following error:

 fatal error: 'gurobi_c++.h' file not found #include "gurobi_c++.h"

I notice I already install a C++ compiler and gurobi too :

>> mex -setup
   MEX configured to use 'Xcode with Clang' for C language compilation.
   Warning: The MATLAB C and Fortran API has changed to support MATLAB
   variables with more than 2^32-1 elements. In the near future
   you will be required to update your code to utilize the
   new API. You can find more information about this at:
   http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

   To choose a different language, select one from the following:
   mex -setup C++ 
   mex -setup FORTRAN

Also Gurobi is correctly installed in my Mac OS :

>> gurobi_setup

   The MATLAB interface for Gurobi 7.0.2 has been installed.

   The directory /Library/gurobi702/mac64/matlab/
   has been added to the MATLAB path.
   To use Gurobi regularly, you must save this new path definition.
   To do this, type the command savepath at the MATLAB prompt. Please consult the MATLAB documentation if necessary.
   >>

Thanks.

Nll
  • 819
  • 5
  • 19
  • 41
  • A C++ compiler is not needed if you use the pre-compiled MATLAB interface. Try running the example as explained in http://www.gurobi.com/documentation/current/quickstart_mac/matlab_running_the_example.html – Greg Glockner May 03 '17 at 14:29
  • Yes I did and the example works correctly... – Nll May 03 '17 at 15:29
  • That shows that Gurobi works correctly for MATLAB. A C++ compiler should not be needed. – Greg Glockner May 03 '17 at 15:32
  • Great, but why when I call gurobi_C++ header I got that the file not found, I don't wanna use gurobi with matlab code, I wish use Gurobi with C++ code in matlab simulink using s-function meaning in a C++ programm? – Nll May 03 '17 at 15:45

0 Answers0