Really Annoying VC++ problem
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.
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)
--------------------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)
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])
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement