Solved

VC++ upgrade to VS.net issue

Posted on 2004-04-22
5
427 Views
Last Modified: 2010-04-24
I have downloaded this project and it was originally compiled with VC++ 6 and I converted it to VS.net 2003 project and when I compile I receive this error.

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

Which comes from this function:

// Calculates the x having the closest 2^x value for the given value
static int _getClosest2Power(double value)
{
   return (int)(log(value) / log(2) + 0.5);
}


How can I make this work?

I am very very fresh to VC++ as I am a vb vet so the most explanations the best.

Thanks to all!
0
Comment
Question by:Sentax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:Sentax
ID: 10891560
I have figured it out.

Sorry for posting.
0
 

Expert Comment

by:moseph
ID: 10910807
Hi Sentax

if you are intending to use the LOG function,
change that line of code to this:
return (int)(Math::Log(value) / Math::Log(2) + 0.5);

hope that helps
0
 

Author Comment

by:Sentax
ID: 10912467
Well thanks moseph but if read the post right above yours I have already solved it.

I didn't use your suggestion and I don't know if yours would work but the solution I did use was:

static int _getClosest2Power(double value)
{
  return (int)(log(value) / log((double)2) + 0.5);
}
0
 
LVL 7

Expert Comment

by:leflon
ID: 10948477
hi Sentax,
please ask CS to delete this Q and refund your pts

leflon
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 11004880
Closed, 50 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Safearray problem c++ 4 96
Convert VC++  mfc  application  multilanguage 9 235
How do I open an Access Data base with a password set using C++ 2 138
SHA256 Code Signing 4 176
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question