Hi all!
I am getting compile errors when it is Linking.
--------------------Configuration: CIRCLE - Win32 Debug--------------------
Compiling...
circle.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/CIRCLE.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
CIRCLE.exe - 2 error(s), 0 warning(s)
# include <iostream.h>
class CCircle {
public:
CCircle( float x, float y, float r ) : m_x(x), m_y(y), m_r(r) {}
~CCircle() {}
float getArea() { return (3.14159f * m_r * m_r);}
void setX(float x) { m_x = x; }
void setY(float y) { m_y = y; }
void setR(float r) { m_r = r; }
float getX() {return m_x; }
float getY() {return m_y; }
float getR() {return m_r; }
private:
float m_x;
float m_y;
float m_r;
};
CCircle gblCircle(5.,5.,10.);
int main(int argc, char *argv[]) {
CCircle lclCircle(10.,10.,5.);
cout << "global circle area" <<
gblCircle.getArea() << endl;
cout << "local circle area" <<
lclCircle.getArea() << endl;
gblCircle.setR(20.0);
lclCircle.setR(15.0);
cout << "global circle area" <<
gblCircle.getArea() << endl;
cout << "local circle area" <<
lclCircle.getArea() << endl;
return 0;
}
I am going through the Ketstone learning CD's and this is an example code and it works for the guy on the video, i am sure I typed it in just like he had it. It did have a couple of errors, but I corrected them.
Thanx, BandM :cry: