This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14421] New: Including a directory having a file named "math.h" -- Weird


This is very uncommon to figure out but when I am including a directory (-I) 
having a file named "math.h" and I am trying to compile a simple test including 
<iostream> I am floded with weird error.

1) Let's say the following file is named test.cpp:
#include <iostream>

using namespace std;

int main()
{
        cout << "Hello" << endl;
}

2) I have a file named math.h in the local directory include/.

3) I am compiling the test application using the following option:
g++ test.cpp -I include/

4) I have hundreds of error messages saying:
In file included from /usr/include/c++/3.3/bits/locale_facets.tcc:41,
                 from /usr/include/c++/3.3/locale:47,
                 from /usr/include/c++/3.3/bits/ostream.tcc:37,
                 from /usr/include/c++/3.3/ostream:535,
                 from /usr/include/c++/3.3/iostream:45,
                 from test.cpp:1:
/usr/include/c++/3.3/cmath: At global scope:
/usr/include/c++/3.3/cmath:107: error: `acosf' not declared
/usr/include/c++/3.3/cmath:110: error: `asinf' not declared
/usr/include/c++/3.3/cmath:113: error: `atanf' not declared
/usr/include/c++/3.3/cmath:116: error: `atan2f' not declared
/usr/include/c++/3.3/cmath:119: error: `ceilf' not declared
/usr/include/c++/3.3/cmath:122: error: `coshf' not declared
/usr/include/c++/3.3/cmath:125: error: `expf' not declared
/usr/include/c++/3.3/cmath:128: error: `floorf' not declared
/usr/include/c++/3.3/cmath:131: error: `fmodf' not declared
/usr/include/c++/3.3/cmath:134: error: `frexpf' not declared
/usr/include/c++/3.3/cmath:137: error: `ldexpf' not declared
/usr/include/c++/3.3/cmath:140: error: `logf' not declared
/usr/include/c++/3.3/cmath:143: error: `log10f' not declared
/usr/include/c++/3.3/cmath:146: error: `modff' not declared
/usr/include/c++/3.3/cmath:149: error: `powf' not declared
/usr/include/c++/3.3/cmath:152: error: `sinhf' not declared
/usr/include/c++/3.3/cmath:155: error: `tanf' not declared
/usr/include/c++/3.3/cmath:158: error: `tanhf' not declared
/usr/include/c++/3.3/cmath: In function `float std::acos(float)':
/usr/include/c++/3.3/cmath:184: error: `acosf' undeclared in namespace `
   __gnu_cxx::__c99_binding'
/usr/include/c++/3.3/cmath: At global scope:
/usr/include/c++/3.3/cmath:190: error: `acos' not declared
/usr/include/c++/3.3/cmath: In function `long double std::acos(long double)':
...



Regards,
Philippe

-- 
           Summary: Including a directory having a file named "math.h" --
                    Weird
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: philippe at fornux dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14421


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]