   [VS2003] strange math.h / cmath error..
  Hi all,I guess this will be one of those "Man that was stupid" questions, but I have been looking at this for quite a while now.I am trying to write some math code (a wrapper + basic vector/matrix stuff) and everyting was working just fine when I included the math.h header. However, I decided to include cmath instead, just because I used the cxxxx versions for everything else. And then this error popped up:C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cmath(17) : error C2039: 'acos' : is not a member of 'operator``global namespace'''C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cmath(17) : error C2873: 'acos' : symbol cannot be used in a using-declarationAnd not just for acos, but for all math functions (until it passes the maximum number of errors :) ). Even though the only function I use (I have commented everything else) is acos. Does anyone have any idea what I could be doing wrong?I'm using VS2003 .NETThanks in advance, Bart.   
  All the functions are in the std namespace, so it's std::acos, std::cos, std::sin etc.   ;  The "cmath" header declares everything in the "std" namespace.Have you tried using "std::acos" or "using namespace std;", and so forth ?;  Hmm, something seems to be seriously screwed up. Even when I just include cmath and don't even use any math function, I still get all the errors. No difference if I do "using namespace std" or not. Perhaps my VS install is seriously screwed up.... Sigh. I wanted this to be a productive day.   ;Quote:Original post by bart_kHmm, something seems to be seriously screwed up. Even when I just include cmath and don't even use any math function, I still get all the errors. No difference if I do "using namespace std" or not. Perhaps my VS install is seriously screwed up.... Sigh. I wanted this to be a productive day.Did you verify the other included files? If there is an error at the end of the file that is included before cmath, it can lead to subtil syntax problems in cmath itself. To verify this, #include <cmath> at the beginning of your compilation unit. Regards,   ;  You may have an error in one of your header files that is being included before you include cmath; often a missing or extra brace or semicolon (et cetera) can cause this kind of thing.   ;  Ah yep. It was indeed in another header. As I thought, I'm an idiot today. Why do these things always happen on days that you decide to make good progress?Thanks to everyone for their time.   