Jump to content
  • Advertisement
Sign in to follow this  
Unknone

NeHe

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

Hi all! I'm going throught the NeHe tutorials and whenever I download the code and move the *.cpp to another file and try to compile it, I get 16 link errors. Please help me someone.

Share this post


Link to post
Share on other sites
Advertisement
I believe the documentation tells you the libraries you need to link, which is OpenGL32.lib, GLu32.lib, and GLAux.lib. However, I do know, there is code on the NeHe site to replace the GLAux code.

Share this post


Link to post
Share on other sites
I'm not having any problems with that. What I'm having problems with is that I download it, and it works. I move the .cpp and make a new workspace for it and compile, and it dies on me. I think it's trying to make me destroy it... very frustrating....

Share this post


Link to post
Share on other sites
Quote:
Original post by Unknone
I'm not having any problems with that. What I'm having problems with is that I download it, and it works. I move the .cpp and make a new workspace for it and compile, and it dies on me.

Yep, that's what they've told you how to deal with, albeit in not much detail. The workspace has settings somewhere for which libraries need to be linked to the project so that it'll be able to compile. If you move the file into a new workspace, you'll have to set up that workspace with the correct linking options.

Lesson 1 tells you how to do it, although the options might differ slightly depending on what IDE you're using. Quoted from the lesson:
Quote:

After you have created a new Win32 Application (NOT a console application) in Visual C++, you will need to link the OpenGL libraries. In Visual C++ go to Project, Settings, and then click on the LINK tab. Under "Object/Library Modules" at the beginning of the line (before kernel32.lib) add OpenGL32.lib GLu32.lib and GLaux.lib. Once you've done this click on OK. You're now ready to write an OpenGL Windows program.

I believe those particular instructions are intended for Visual C++ 6, so if you're not using that and can't figure out where to find those options in your particular IDE, let us know which one it is and we'll see if we can help.

Share this post


Link to post
Share on other sites
OK. Didn't see that bit. I did it and it got rid of all OpenGL related errors. Now there are only 2 left lol. *sigh* My luck....

All that is is left is:

LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson1.exe : fatal error LNK1120: 1 unresolved externals

I know what the second one is, but I have had the first in a few projects in past times and never got around to working it out. Can someone help me please?

Share this post


Link to post
Share on other sites
It looks like you don't have a main() function. The main function is the entry point for the program-- ie WinMain() for a windows application and main() for a typical console program. Provided you're compiling the examples and haven't changed any of the source code, you may have created a console application workspace instead of a windows application workspace. Try creating the workspace as a windows application and try again.

PS. Don't forget to link the OpenGL libraries again.

Share this post


Link to post
Share on other sites
Lol. I may be new to programming, but I'm not that stupid. Yes, it is a Win32 Application. I know that the error is asking for a main. But I don't know why, esspecially 'cus Main() is for console apps. I have a WinMain() Function.

Share this post


Link to post
Share on other sites
Alright alright, get this. I just played around with it, and if I change the WinMain Function to main(), it works. Someone explain.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
"...it is a Win32 Application"
A console applicaion is a *win32 applicaion* too...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!