error
I took lesson 1 tutorial from nehe and run the programm in v C++, had an error like the following..what does it mean?
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
September 24, 2003 05:53 AM
I had that problem for months and I still have it. The only solution I found is this: make an int main function like such:
int main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
WinMin(hInstance,hPrevInsance,lpCmdLine,nShowCmd);
return 0;
}
This is probably not the best way to do it, and it is not very professional, but it works every time without errors.
By the way, I know how pissed off you must be trying for hours without being able to run Lesson 1... same thing happened to me.
int main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
WinMin(hInstance,hPrevInsance,lpCmdLine,nShowCmd);
return 0;
}
This is probably not the best way to do it, and it is not very professional, but it works every time without errors.
By the way, I know how pissed off you must be trying for hours without being able to run Lesson 1... same thing happened to me.
Take a look at the skeletal animation post abou 6 messages below yours. more unresolved externals and more helpful tips.
unresolved externals was usually libraries for me
unresolved externals was usually libraries for me
Seb:
your problem is not with libraries or anything of the sort. You tried loading in some sourcecode that is meant for a win32 project, but placed it into a console application. What is meant by "unresolved external symbol _main" is that it can't find the entry point for the program, which for console applications, is void main().
Try taking that code and putting it into a new project. Open up VC++, goto "new" and then "win32 application". create the project and load in the sourcecode.
Note somewhere in the sourcecode you should find a function called "WinMain", this is the entry point for win32 applications. This means it's a win32 program, not a console program. (hope i haven't confused you)
If you had just double-clicked on the .dsw file that came with the sourcode, you shouldn't have any errors.
Note that the sourcecode you should have downloaded should be for your OS system. If your running windows xp or lower, double-check what you downloaded: it should be entitled "your first polygon" or "setting up an opengl window". If it is, just double-click the .dsw file that came with the download, you should be fine.
Hope that helped you guys out
[edited by - BriW111 on September 24, 2003 3:35:03 PM]
your problem is not with libraries or anything of the sort. You tried loading in some sourcecode that is meant for a win32 project, but placed it into a console application. What is meant by "unresolved external symbol _main" is that it can't find the entry point for the program, which for console applications, is void main().
Try taking that code and putting it into a new project. Open up VC++, goto "new" and then "win32 application". create the project and load in the sourcecode.
Note somewhere in the sourcecode you should find a function called "WinMain", this is the entry point for win32 applications. This means it's a win32 program, not a console program. (hope i haven't confused you)
If you had just double-clicked on the .dsw file that came with the sourcode, you shouldn't have any errors.
Note that the sourcecode you should have downloaded should be for your OS system. If your running windows xp or lower, double-check what you downloaded: it should be entitled "your first polygon" or "setting up an opengl window". If it is, just double-click the .dsw file that came with the download, you should be fine.
Hope that helped you guys out
[edited by - BriW111 on September 24, 2003 3:35:03 PM]
Alt-F7 under Ms VC
Change the line :
system:console by system:windows
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
Change the line :
system:console by system:windows
========================
Leyder Dylan (dylan.leyder@slug-production.be.tf
http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement