#include : “In FIle included from” error m

2019-09-20 08:23发布

I want to use <cmath>. If I do:

#include <cmath> 

I get the error message:

"In File included from"

However, when I type <cma and do ctrl+spacebar (in Netbeans) it shows me all the files available and cmath is listed (its in /usr/include/c++/4.7). I dont understand why the GUI editor/intellisense knows the cmath header exists, but I have the error "In File included from"?

Full error message:

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'

These are my include directories:

/opt/intel/include;

/usr/include/boost;

/usr/include

EDIT (For Chris):

#ifndef MYFILE_H
#define MYFILE_H

#include <cmath>


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

    private:
};

#endif

1条回答
爷的心禁止访问
2楼-- · 2019-09-20 09:12

Netbeans is aware of several standard library headers, but this does not guarantee that your path has been correctly configured. Check to insure that your path is correctly configured, and that you are using the correct toolchain.

Without a more detailed error message I can't tell you much more than that.

查看更多
登录 后发表回答