Solved

VC++ upgrade to VS.net issue

Posted on 2004-04-22
5
421 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
Comment Utility
I have figured it out.

Sorry for posting.
0
 

Expert Comment

by:moseph
Comment Utility
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
Comment Utility
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
Comment Utility
hi Sentax,
please ask CS to delete this Q and refund your pts

leflon
0
 

Accepted Solution

by:
PashaMod earned 0 total points
Comment Utility
Closed, 50 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now