Solved

VC++ upgrade to VS.net issue

Posted on 2004-04-22
5
424 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
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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