CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    79

    is not a member of 'std'

    Hi...
    It seems I'm always having problems with the std:: thing...

    When I try this:

    Code:
    #include <limits>
    
    using namespace std;
    
    
    
    int main(){
    
    	double log_double_max = std::log(std::numeric_limits<double>::max());
    	const double log_double_min = log(numeric_limits<double>::min());
                    return(0);
    }
    I get the following error messages:

    error C2039: 'log' : is not a member of 'std'
    error C2589: '(' : illegal token on right side of '::'
    error C2143: syntax error : missing ')' before '::'
    etc...
    Nevertheless, when I type std:: the object browser pops up and I see the log, numeric_limits and all the other functions.

    So why do I get this error: error C2039: 'log' : is not a member of 'std' then?

    Thanks for your input on this.

    Niko

  2. #2
    Join Date
    Oct 2002
    Location
    Austria
    Posts
    1,284

    Re: is not a member of 'std'

    Code:
     #include <cmath>
    should help
    Kurt

  3. #3
    Join Date
    Sep 2005
    Location
    New Delhi, India
    Posts
    332

    Re: is not a member of 'std'

    Like Zuk said, you need to include <cmath> for log function. You can find all the details of library functions and header from this link
    Appreciate others by rating good posts

    "Only buy something that you'd be perfectly happy to hold if the market shut down for 10 years." - Warren Buffett

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured