Archived

This topic is now archived and is closed to further replies.

Really Annoying VC++ problem

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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])

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites