Problem mit math.h

RuLaMaN

Grünschnabel
Hallo,

habe da ein Problem mit der math.h in meinem MFC-Projekt und zwar erkennt der die sinf(), cosf, fabs etc. alle nich, obwohl die math.h eigentlich eingebunden is. Hab auch schon viele sachen ausprobiert, kommen immer die folgenden Fehler:

z.B.:

e:\Arbeitsmappe\MeanFly\Tools\LevelEditor\Source\Vector3.h(66) : error C3861: 'sqrtf': identifier not found, even with argument-dependent lookup

Muss ich da irgendwie ne andere Header nehmen oder an was kann das liegen Das komische is auch ich hab noch nen anderes Projekt in dem das ganze funktioniert. Hab auch schon in den Projectsettings geschaut, scheint aber alles gleich zu sein. Danke fürs Antworten

MFG Hannes
 
Das hier ist C-Runtime (nicht C++) :
Code:
// crt_sqrt.c
/* This program calculates a square root. */

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

int main( void )
{
   double question = 45.35, answer;

   answer = sqrt( question );
   if( question < 0 )
      printf( "Error: sqrt returns %.2f\n, answer" );
   else
      printf( "The square root of %.2f is %.2f\n", question, answer );
}
Quelle: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sqrt.asp

und das hier ist ein C++ (STL) Beispiel:
Code:
// valarray_sqrt.cpp
// compile with: /EHsc
#include <valarray>
#include <iostream>
#include <cmath>

int main( )
{
   using namespace std;
   int i;

   valarray<double> va1 ( 6 );
   for ( i = 0 ; i < 5 ; i++ )
      va1 [ i ] = i * i;

   valarray<double> va2 = sqrt ( va1 );

   cout << "The square root of the initial valarray is: ( ";
      for ( i = 0 ; i < 5 ; i++ )
         cout << va2 [ i ] << " ";
   cout << ")." << endl;
}
Auszug aus: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrf_valarray_sqrt.asp
 
Das Problem hatte ich auch mal, da mußte ich <math.h> als letztes #include angeben, sonst wurde es anscheinend irgendwie ignoriert. Würde mich auch mal interessieren, was das soll.
 
Zurück