iQD
05-29-2009, 09:02 PM
Hi,
i tried to compile 2.0.3 with gcc 4.0.0 an gcc 4.2.0 on OS X.
There's the file math.h in API/Core/Math which includes <cmath>.
cmath itself includes <math.h>.
So the compiler gives following error(s):
(for exmple compiling init_linux.cpp, angle.cpp etc.)
/usr/include/c++/4.0.0/cmath:99: error: '::acos' has not been declared
/usr/include/c++/4.0.0/cmath:378: error: '::sinh' has not been declared
[...]
/usr/include/c++/4.0.0/cmath:408: error: '::tan' has not been declared
/usr/include/c++/4.0.0/cmath:423: error: '::tanh' has not been declared
Seems that the local math.h file is clashing with the system header math.h .
After i renamed the local math.h (to cl_math.h) it worked fine.
Compiling on Linux and Windows with actual gcc works without renaming.
The question:
1. Anyone knows of a compiler bug? special compiler options?
2. Wouldn't it be much better to rename the local math.h for compatibility? (if its not a compiler bug)
3. Are there some include guards possible (tried some #ifdef _MATH_H, #ifdef _CL_MATH_ etc. but neither worked)?
After searching google, some guys mentioned, that they have those problems also with other libs (other than clanlib) and >= gcc 4.3.x etc.
Thanks for your time.
i tried to compile 2.0.3 with gcc 4.0.0 an gcc 4.2.0 on OS X.
There's the file math.h in API/Core/Math which includes <cmath>.
cmath itself includes <math.h>.
So the compiler gives following error(s):
(for exmple compiling init_linux.cpp, angle.cpp etc.)
/usr/include/c++/4.0.0/cmath:99: error: '::acos' has not been declared
/usr/include/c++/4.0.0/cmath:378: error: '::sinh' has not been declared
[...]
/usr/include/c++/4.0.0/cmath:408: error: '::tan' has not been declared
/usr/include/c++/4.0.0/cmath:423: error: '::tanh' has not been declared
Seems that the local math.h file is clashing with the system header math.h .
After i renamed the local math.h (to cl_math.h) it worked fine.
Compiling on Linux and Windows with actual gcc works without renaming.
The question:
1. Anyone knows of a compiler bug? special compiler options?
2. Wouldn't it be much better to rename the local math.h for compatibility? (if its not a compiler bug)
3. Are there some include guards possible (tried some #ifdef _MATH_H, #ifdef _CL_MATH_ etc. but neither worked)?
After searching google, some guys mentioned, that they have those problems also with other libs (other than clanlib) and >= gcc 4.3.x etc.
Thanks for your time.