NeHe

Started by
13 comments, last by Unknone 18 years ago
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.
Regardz,UnknoneCheck out my site! Click Here!
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.

I know only that which I know, but I do not know what I know.
Also, it uses some third-party function. You need the code or the libraries of them to do the compile.
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....
Regardz,UnknoneCheck out my site! Click Here!
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.

- Jason Astle-Adams

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?
Regardz,UnknoneCheck out my site! Click Here!
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.

I know only that which I know, but I do not know what I know.
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.
Regardz,UnknoneCheck out my site! Click Here!
Alright alright, get this. I just played around with it, and if I change the WinMain Function to main(), it works. Someone explain.
Regardz,UnknoneCheck out my site! Click Here!
"...it is a Win32 Application"
A console applicaion is a *win32 applicaion* too...

This topic is closed to new replies.

Advertisement