views:

36

answers:

1

I used to work with math.h without any problem. Now, I use an external library which itself has a file called math.h, but which includes < cmath>.

Adding this library to my project (or even just adding the include directory, without touching the code) now generates tons of errors from < cmath> :

C:\Program Files\Microsoft Visual Studio 8\VC\include\cmath(18) : error C2039: 'acosf' : is not a member of '`global namespace''

C:\Program Files\Microsoft Visual Studio 8\VC\include\cmath(18) : error C2873: 'acosf' : symbol cannot be used in a using-declaration

C:\Program Files\Microsoft Visual Studio 8\VC\include\cmath(18) : error C2039: 'asinf' : is not a member of '`global namespace''

C:\Program Files\Microsoft Visual Studio 8\VC\include\cmath(18) : error C2873: 'asinf' : symbol cannot be used in a using-declaration

[etc, etc...]

I don't understand why this happens. I am using Visual Studio 2005 and looking on the internet, it seems that this problem is solved under VS 2008. However, I'd like to stay on VS 2005...

Including using namespace std; everywhere, or changing the order of my includes doesn't seem to change anything. Defining _STD_BEGIN solves the error, but produce as many in < xlocinfo>.

How can this be solved?

+1  A: 

I'm not sure I read your question correctly but it seems odd that a library would ship it's own math.h file.

Perhaps you are suppose to put the parent directory in your include path so that <my_lib/math.h> can be included without conflicting with your compiler <math.h>?

Alexandre Jasmin