Linking Problem

My code compiles fine. At linking time, I get this errors:

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16

Debug/Tree.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Tree.exe - 2 error(s), 0 warning(s)

I am using microsoft Visual C++. Can any one help me please.

You’re probably using a Windows Application instead of a Windows “Console” Application or vice versa. A windows app needs a WinMain, while a console app needs a main. I think it’s better to create a new project for a console app and copy everything over the main cpp file. If you get into any more trouble provide a little more information as to if your using glut or something else.

Thanks a lot for your help. The Linking problem is gone now. Another problem I have is that:
When I execute (or run) my program, it works fine and I can see the drawing. But when I run the “exe” file located in the “Debug” folder, it will only show the drawing window without the drawing.

If your program depends on some other files(textures models …) you’ll need to copy exe file into project directory

Thanks a lot. The program uses an input.dat file to get the coordinates. I put the input.dat file in same folder with .exe file and it is working fine now. Thanks for your help guys.