Advertisement

Linker error

Started by October 17, 2005 06:10 PM
10 comments, last by GameDev.net 19 years ago
When i try compiling Lesson 1 from NeHe's site I get several linker errors, [Linker error] undefined reference to `glViewport@16' that being one of them, am I missing a file? or is it my compiler?
C:DosC:DosRunRunDosRun!
It sounds like you didn't include the gl libs in your project (and, hence, LINK to them).
Advertisement
I downloaded the source for lesson 1, ergo, its not my project.. And there's nothing wrong in the script.
C:DosC:DosRunRunDosRun!
The solution depends on how you are building the lesson. This should work with Microsoft build systems (add to the top of your source file):

#pragma comment( lib, "opengl32.lib" )					// Search For OpenGL32.lib While Linking#pragma comment( lib, "glu32.lib" )					// Search For GLu32.lib While Linking#pragma comment( lib, "vfw32.lib" )					// Search For VFW32.lib While Linking


Cheers,
- llvllatrix
I ran a search for those files on my computer and i don't have them :( where can i get them? and im just using Dev-C++ to compile it.
C:DosC:DosRunRunDosRun!
http://www.opengl.org/resources/faq/getting_started.html

Cheers,
- llvllatrix
Advertisement
Quote: I ran a search for those files on my computer and i don't have them :( where can i get them? and im just using Dev-C++ to compile it.

MinGW doesn't use .lib files. It use .a and .o files instead. Just go to project options and add opengl32 and glu32 to your links.

Succes!
Thank you, that fixed it.

[Edited by - Crashman on October 18, 2005 7:26:31 PM]
C:DosC:DosRunRunDosRun!
Great.. now i have another linker error.

[Linker error] undefined reference to `auxDIBImageLoadA@4'

I was compiling lesson 6 of NeHe's OpenGL tutorial.. is there anyway way to find out what file im supposed to include in the project?

the header line is #include <stdio.h> and i dont have a libstdio.a file for MinGW.
C:DosC:DosRunRunDosRun!
It seems you do not have glaux. You can get it from www.devpaks.org.
Do not forget to link it! Project->Project option->Params->Linker add -lglaux
Also you should check the Dev-Cpp forum, the Read before posting thread. You will find how to setup GL in Dev-Cpp.

This topic is closed to new replies.

Advertisement