Really Annoying VC++ problem

Started by
6 comments, last by asdasd12345 20 years, 5 months ago
Im very new to VC++ 6.0 as I was working with DevC++ before. When I make a program, I compile it, then I goto the Build menu, and execute command and it works fine. Then I close VC++ and reopen it, open up the same file and compile it, and that works, but when I try and build I get 2 errors. Linking... gamemain.obj : error LNK2001: unresolved external symbol "void __cdecl GameInit(void)" (?GameInit@@YAXXZ) Debug/breakout.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. breakout.exe - 2 error(s), 0 warning(s) Then I have to copy and paste my whole code into a new project again and it builds fine. Can someone please tell me what the problem is so I dont have to keep on making a new project everytime I want to work on my program? Thanks.
http://www.geocities.com/asdasd12345/
Advertisement
Sounds like a project file problem. Maybe you''re not saving your project files?

Skizz
quote:Original post by asdasd12345
Im very new to VC++ 6.0 as I was working with DevC++ before. When I make a program, I compile it, then I goto the Build menu, and execute command and it works fine. Then I close VC++ and reopen it, open up the same file and compile it, and that works, but when I try and build I get 2 errors.

Linking...
gamemain.obj : error LNK2001: unresolved external symbol "void __cdecl GameInit(void)" (?GameInit@@YAXXZ)
Debug/breakout.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

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

Then I have to copy and paste my whole code into a new project again and it builds fine. Can someone please tell me what the problem is so I dont have to keep on making a new project everytime I want to work on my program? Thanks.


When you re-open your project, do you open the DSW file (breakout.dsw)? If not, then that is why.

Else, I dunno why.
OK Here is one I got when trying it with a different program:

--------------------Configuration: game3 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/game3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

game3.exe - 2 error(s), 0 warning(s)
http://www.geocities.com/asdasd12345/
quote:Original post by asdasd12345
OK Here is one I got when trying it with a different program:

--------------------Configuration: game3 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/game3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

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


Ok, answer these questions:

1. O/S
2. What graphics library (DirectX, OpenGL, GDI [Windows])
Windows xp, windows gdi

[edited by - asdasd12345 on November 13, 2003 2:44:42 PM]
http://www.geocities.com/asdasd12345/
You need to change your project type. You have it set to a console application, and so the compiler is looking for main. You actually want to set it to a windows application. It should be in the project settings somewhere.
OK I understand now thanks.
http://www.geocities.com/asdasd12345/

This topic is closed to new replies.

Advertisement