I want to do graphics programming using OpenGl and I downloaded the widely recommended Neon Helium tutorials. However, as soon as I tried to Build (I am using Visual C++ Express), I got the following errors:
error LNK2005: _WinMain@16 already defined in lesson1.obj error LNK2005: "long _stdcall WndProc(struct HWND_ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) already defined in lesson1.obj fatal error LNK1169: one or more multiply defined symbols found
I'll explain what I did step by step so that it will easier for someone to point out my mistake.
- Downloaded GLUT and GLAUX libraries. Put glaux.h and glut.h in C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\gl
- Put glut32.lib and glaux.lib in C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib
- Created a folder called DLLs wherein I put glu32.dll, glut.dll, glut32.dll and opengl32.dll, and added that folder to my system path.
- Created a new project in VC++ 2010 called Project 1. VC++ creates two source files called Project1.cpp and stdfax.cpp. I then added another .cpp source file named lesson1 and copy pasted the lesson1 code from NeHe in it.
Now when I try to build the project, it gives me the above errors. Could this be because the NeHe tutorials are written for VC++ 6.0? I notice that there are two glut dll files (glut32.dll and glut.dll). Could this be the problem? Should I delete on of them? Also, there isn't a glaux.dll file. Do I have to hunt for it so that my problem will be solved? If anyone can help me solve my problem I'd be really grateful. Many thanks to all the people who answered my previous question