#include <cmath> :"In FIle included from"错误消息?

#include <cmath> : "In FIle included from" error message?

本文关键字:from included 错误 消息 FIle In cmath gt #include lt      更新时间:2023-10-16

我想用<cmath> .如果我这样做:

#include <cmath> 

我收到错误消息:

"在文件中包含自"

但是,当我键入 <cma 并执行 ctrl+空格键(在 Netbeans 中)时,它会显示所有可用的文件,并列出了cmath(在/usr/include/c++/4.7 中)。我不明白为什么 GUI 编辑器/智能感知知道cmath标头存在,但我有错误"在文件中包含自"?

完整的错误消息:

In file included from /usr/include/c++/4.7/cmath:46:0,
                 from ../../Documents/FD/MyFile.h:4,
                 from ../../Documents/FD/MyFIle.cpp:1:
/opt/intel/include/math.h:27:3: error: #error "This Intel <math.h> is for use with only the Intel compilers!"
make[2]: *** [build/Debug/GNU-Linux-x86/_ext/2009285305/MyFile.o] Error 1
make[2]: Leaving directory `/home/me/NetBeansProjects/Project'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/me/NetBeansProjects/Project'

这些是我的包含目录:

/

opt/intel/include;

/

usr/include/boost;

/

usr/include

编辑(对于克里斯):

#ifndef MYFILE_H
#define MYFILE_H
#include <cmath>

class MyFile{
    public:
        static double doesntmatter(double x, int y, double z);
    private:
};
#endif

Netbeans 知道几个标准库标头,但这并不能保证您的路径已正确配置。 检查以确保路径配置正确,并且使用的工具链正确。

如果没有更详细的错误消息,我无法告诉您更多。