Help Error in MSVC++ .NET version

  • C/C++
  • Thread starter Math Is Hard
  • Start date
  • Tags
    Error
In summary, The conversation is about using Visual C++ .NET and encountering an error with a line of code that worked in MSVC++ v6. The error is caused by an ambiguous call to the log function in cmath and can be resolved by using double typecasting or parentheses.
  • #1
Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
4,652
37
Is anyone here using Visual C++ .NET?
I have a line of code that works fine in MSVC++ v6, but I am getting an error in MSVC++ .NET. :mad: :cry: :cry:

Here's the line:

expo = (log(num))/(log(10));

and the error message I get:

error C2668: 'log': ambiguous call to overloaded function

expo is a type int variable. so is num.
I am using the cmath header:
#include <cmath>

Thanks for any help!
 
Technology news on Phys.org
  • #2
It should be:

expo = log((double)num)/log(10.) ;

And you'll get a warning if expo is not a double. num can stay int since I've typecasted it.

The log function in cmath is defined as:

double log( double )
long double log( long double )
float log( float )
 
Last edited:
  • #3
Thanks, dduardo. I was breaking out in a mild panic!
Is what you did there the same as using static_cast<double>?
 
  • #4
Yeah, you can write it either way. The parentheses is just a shorthand.
 
Last edited:
  • #5
oh, ok... thanks!
 

What is "Help Error in MSVC++ .NET version"?

"Help Error in MSVC++ .NET version" is an error message that may appear when using Microsoft Visual C++ .NET. It typically indicates a problem with the help system in the software.

Why am I getting this error?

There could be several reasons why this error is appearing. It could be due to a corrupt installation of MSVC++ .NET, missing or damaged help files, or conflicts with other software on your computer.

How can I fix this error?

The first step to fixing this error is to try reinstalling MSVC++ .NET. If that does not work, you may need to repair or replace any missing or damaged help files. You can also try running the software in compatibility mode or disabling any conflicting software.

Can this error be prevented?

While it is difficult to prevent this error from occurring, there are some steps you can take to minimize the chances of encountering it. These include regularly updating your software, avoiding conflicting software, and keeping your computer free of viruses and malware.

Is there any support available for this error?

If you are unable to resolve this error on your own, you can seek support from Microsoft or the community of MSVC++ .NET users. You can also try searching online for solutions or troubleshooting guides for this specific error.

Similar threads

  • Programming and Computer Science
Replies
2
Views
353
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
2
Replies
57
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
5
Views
9K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
Back
Top