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:

You're using a Win32 application project when you want a console application project. Win32 applications expect WinMain instead of main.

I was posting it before I saw wath you said, and since there are no way of deleting post I dident want a emty post.

You can edit and delete a post within 30 minutes of posting it.

Mkey, I belived that one could only edit, will rember that then :)

Thanks Guy's!

That was it! Funny how one wrong step can make a big difference :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.