Problems including MATLAB “engine.h” for C++ code

后端 未结 4 2380
一个人的身影
一个人的身影 2021-02-20 10:11

I am trying to run the example code from the MATLAB Doc, but when I try to build the project in Visual Studio I get this error

fatal error C1083: Cannot open inc         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 11:13

    While the Jav_Rock's answer is completely correct, I want to add information about one of the points:

    1.- Set Path variable in Advanced System Settings-> environment variables: C:\Program Files\MATLAB\R2010a\bin\win64 (or the path where libeng.dll is located)

    I spent three hours to understant what does it means, so I want to clarify this moment for future researchers. You need to add the path of MATLAB Engine dll libraries to your Windows. We can do it this way:

    My Computer -> right click: Settings. Opened System window. Left bottom corner: Advanced System Settings

    Advanced Tab

    In the Environment variables for your user press Create... button and add this one: Variable name: PATH Variable value: C:\Program Files\MATLAB\R2016a\bin\win64

    This path is reference on where is your libeng.dll located. Important moment: it can require to restart VS or even restart computer.

提交回复
热议问题