致命错误C1083:不能打开包含文件:'mexutils。没有这样的文件或目录。

时间:2022-11-26 18:13:12

I would like to compile a c++ file as a mex file in MATLAB namely: "mexLasso.cpp".

我想在MATLAB中编译一个c++文件,即:“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?

有人能帮助我们吗?

2 个解决方案

#1


1  

From the mex command line tool reference, there is an argument for adding include paths:

在mex命令行工具引用中,有一个关于添加include路径的参数:

-Ipathname Adds pathname to the list of folders to search for #include files.
Do not add a space between I and pathname.

-Ipathname将路径名添加到要搜索#include文件的文件夹列表中。不要在我和路径名之间添加空格。

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.

请注意,如果您没有指定header,那么您将指定包含一个或多个头文件的路径。

#2


0  

Thanks for your comments. I think the besy way to solve my problem is to install SPAMS in my machine and successfully compile it. I have posted the steps I take in this post :

谢谢你的评论。我认为解决我的问题的方法是在我的机器上安装SPAMS并成功地编译它。我已经发布了我在这篇文章中所采取的步骤:

How to install SPAMS toolbox in Matlab 2014b under windows 8.1

如何在windows8.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.

多谢。

#1


1  

From the mex command line tool reference, there is an argument for adding include paths:

在mex命令行工具引用中,有一个关于添加include路径的参数:

-Ipathname Adds pathname to the list of folders to search for #include files.
Do not add a space between I and pathname.

-Ipathname将路径名添加到要搜索#include文件的文件夹列表中。不要在我和路径名之间添加空格。

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.

请注意,如果您没有指定header,那么您将指定包含一个或多个头文件的路径。

#2


0  

Thanks for your comments. I think the besy way to solve my problem is to install SPAMS in my machine and successfully compile it. I have posted the steps I take in this post :

谢谢你的评论。我认为解决我的问题的方法是在我的机器上安装SPAMS并成功地编译它。我已经发布了我在这篇文章中所采取的步骤:

How to install SPAMS toolbox in Matlab 2014b under windows 8.1

如何在windows8.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.

多谢。