Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > Platform/API C++

Reply
 
LinkBack Thread Tools Display Modes
Old 03-16-2005, 02:09 AM   #1 (permalink)
gabriyel
Registered User
 
Join Date: Mar 2005
Posts: 1
gabriyel is on a distinguished road
help: compiler complains about overloading

hi,

i'm using msvs .net 2003. i'm using plain c++. when i compile a piece of code that uses pow(), there are a ton of complains from the compiler than pow() can be overloaded in more than 1 way and it doesn't which way i'm using.

can someone tell me how i can work-around this kind of stringent checks from the compiler?

thanks in advance!


Compiling...
bump_mapping__step_1.cpp
c:\Program Files\NVIDIA Corporation\SDK\DEMOS\OpenGL\inc\glh\glh_glut.h(55 8) : error C2666: 'pow' : 7 overloads have similar conversions
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(620): could be 'long double pow(long double,int)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(618): or 'long double pow(long double,long double)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(572): or 'float pow(float,int)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(570): or 'float pow(float,float)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(534): or 'double pow(int,int)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(532): or 'double pow(double,int)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(195): or 'double pow(double,double)'
while trying to match the argument list '(int, double)'
gabriyel is offline   Reply With Quote
Old 03-16-2005, 02:20 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
This is very compiler specific, and has nothing to do with strict C/C++ so it has been moved to a more apropriate forum.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 03-16-2005, 06:12 AM   #3 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
If he rephrases the problem then it might be my concern
Post the code gabriyel. If it is standard C++ specific then I'll move it back again. Might as well solve it for you too .
__________________
Valmont is offline   Reply With Quote
Old 03-19-2005, 12:38 AM   #4 (permalink)
QUantumAnenome
Code Monkey
 
Join Date: Mar 2005
Posts: 56
QUantumAnenome is on a distinguished road
Send a message via Yahoo to QUantumAnenome
I just ran into this same problem. There are several pow() functions, because they covered all possibilities of argument flavors. I got an error because I happened to use one that didn't exist, pow(int, double). To fix it, I just typecast my int to a double;

int i;
double d, e;
...
e = pow((double)i, d);
QUantumAnenome is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner - Borland Compiler question Redline Platform/API C++ 1 11-08-2004 02:34 AM


All times are GMT -8. The time now is 12:12 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting