SOS !! NMAKE : fatal error U1077: 'cl' : return code '0x2'

hi, everyone. I am a new comer to the visual studio. I am currently doing a project and need to use a simulation software called "qualnet". My lab pc is with installed "Visual Studio .NET 2003" and I want to use "Visual C++" to extend the "qualnet" functions.

I did the following steps to try to compile the "qualnet" source:

1. open "command prompt", go to directory "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin" and type "vcvars32", then "enter" to configure environmental variables needed by "Visual C++"

2. "Visual C++" command line tool should be avaiable after my first step. then I go to "qualnet" main directory to run:"nmake", and I get the following error message:
c:\qualnet\3.7\include\random.h(230) : error C2666: 'pow' : 7 overloads have si
ilar conversions
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(6
0): could be 'long double pow(long double,int)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(6
8): or 'long double pow(long double,long double)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(5
2): or 'float pow(float,int)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(5
0): or 'float pow(float,float)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(5
4): or 'double pow(int,int)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(5
2): or 'double pow(double,int)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(1
5): or 'double pow(double,double)'
while trying to match the argument list '(long, double)'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

I guess there must be something wrong with my "Visual studio .NET" configuration.
Wish to hear your replies :) thanks a lot!!!!!

[1944 byte] By [xuemingqiang] at [2007-12-16]
# 1
How are you using the pow function in random.h? Probably the parameter lists are too similar for the compiler to resolve ambiguity. To resolve the issue you can explicitly case the paramters.

For example, compiling the below sample.cpp (cl sample.cpp) will generate the same error (C2666)
//sample.cpp
#include <math.h>
void main()
{
pow(1,2.5);
}

But if you change the sample by adding a cast to the first parameter and compile the same way (cl sample.cpp), the error should go away.
//sample.cpp
#include <math.h>
void main()
{
pow((double)1,2.5);
}

To know more about this specific error (C2666), please visit:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/C2666.asp

Hope this helps!

Thanks,
Ayman Shoukry
VC++ Team

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...