Jump to content
  • Advertisement


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



This topic is 5477 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

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.

Share this post

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


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.

Share this post

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

Share this post

Link to post
Share on other sites

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]

Share this post

Link to post
Share on other sites
Alt-F7 under Ms VC

Change the line :

system:console by system:windows

Leyder Dylan (dylan.leyder@slug-production.be.tf

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!