[英]fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory
I would like to compile a c++ file as a mex file in MATLAB namely: "mexLasso.cpp". 我想在MATLAB中将c ++文件编译为mex文件,即:“ mexLasso.cpp”。
These are the steps I take and I get the following error. 这些是我采取的步骤,但出现以下错误。 What is the problem?
问题是什么?
1. Put the files "mexLasso.cpp" and "mexutils.h" in a folder. 1.将文件“ mexLasso.cpp”和“ mexutils.h”放在一个文件夹中。
2. Set the compiler: 2.设置编译器:
mex -setup C++
I recieve: 我收到:
MEX configured to use 'Microsoft Visual C++ 2013 Professional' for C++ language compilation.
3. Run the command: 3.运行命令:
mex C:\...\mexLasso.cpp
I recieve the following error: 我收到以下错误:
Error using mex
mexLasso.cpp
C:\...\mexLasso.cpp(33) : fatal error C1083: Cannot
open include file: 'mexutils.h': No such file or directory
Can somebody help us what we are missing? 有人可以帮助我们我们所缺少的吗?
From the mex
command line tool reference , there is an argument for adding include paths: 在
mex
命令行工具参考中 ,有一个用于添加包含路径的参数:
-Ipathname
Adds pathname to the list of folders to search for #include files.-Ipathname
将路径名添加到要搜索#include文件的文件夹列表中。
Do not add a space between I and pathname.不要在I和路径名之间添加空格。
Like this: 像这样:
mex -v -IC:\path\to\mexutils_h\ mexLasso.cpp
Note that with -I
you are not specifying the header, you are specifying a path containing one or more header files. 请注意,使用
-I
您未指定标头,而是指定了包含一个或多个标头文件的路径。
Thanks for your comments. 感谢您的意见。 I think the besy way to solve my problem is to install SPAMS in my machine and successfully compile it.
我认为解决问题的好方法是在我的计算机上安装SPAMS并成功编译它。 I have posted the steps I take in this post :
我已经发布了我在这篇文章中采取的步骤:
How to install SPAMS toolbox in Matlab 2014b under windows 8.1 如何在Windows 8.1下的Matlab 2014b中安装SPAMS工具箱
Can I have your opinion there. 我可以在那儿发表您的意见吗? Sorry for duplicated message, only for relevancy and importance of the discussed topic.
对不起,重复消息,仅是所讨论主题的相关性和重要性。
Many thanks. 非常感谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.