When using Matlab and vs for mixed programming, you always need to use MATLAB to compile the mexfunction. cpp file. These files are inevitably using *. h under include and *. Lib under Lib. For example, opencv/cv. h is used in CPP. In the MATLAB \ bin \ win64 \ mexopts folder, there is a batch processing file of msvsopts100.bat. Use NotePad to open the file and add the desired path after "include =" and "Lib =" and add the plus points ";" and save the settings. Then, input MEX Mexico function. cpp in MATLAB. However, the cannot open file "opencv/cv. h" still appears ". Why? Observe carefully and find that the row 6th in mscvopts100.bat contains the following sentence: rem c ++ keyname: Microsoft Visual C ++ 2010. This statement proves that mscvopts100.bat was modified during the Mex-setup process. Therefore, we can guess that you need to re-Execute Mex-setup to make these paths take effect. This is true after tests. It bothered me for two weeks. I hope you can save time.
Path Problems During Mex compilation using Matlab