Start Learning The C Programming Language

This is the first C programming language study note.


I recently installed VC++ 2005 EXP edition.

1) I created a project name Radius and created two new items hello.cpp and area.cpp.

2) area.cpp is the first item and hello.cpp is the second one.

3) When I build the project Radius, I got the error

LNK2005: _main already defined in area.obj

This error is because of multiple definitions of main. You must have defined main in area.cpp as well as in hello.cpp. In C/C++ programs, you can write only one main per application.

Remove one definition of main and it should work fine.



Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s