PDA

View Full Version : Bunch of linking errors: #2019



Shamino
02-18-2008, 12:40 PM
I include these header files at the beginning of my project main.cpp:


#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The Glaux Library



Main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Main.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Main.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Main.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

I'm sure it has to do with either me not having the opengl files I need, or if my project settings are incorrect. I'm working with Visual Studio 2005 express C++. Any ideas why this is happening?

-NiCo-
02-18-2008, 12:45 PM
You need to add opengl32.lib and glu32.lib to the linker dependencies of your project. Here's (http://csf11.acs.uwosh.edu/cs371/visualstudio/) and example of how to do this in VS 2003.

N.

Shamino
02-18-2008, 01:13 PM
Mmk, I resolved that issue, I think it's finding my dependencies now, but now I'm getting this linker error.

LINK : fatal error LNK1104: cannot open file ';.obj'

Any ideas on that one?
I looked at help and it wasn't very helpful lol.

-NiCo-
02-18-2008, 01:23 PM
Maybe you put a ; character where it doesn't belong, probably in the link command...

N.

Shamino
02-18-2008, 02:28 PM
Fixed the dependency issues, but now I have a question, If my project was already set as a precompiled header, will I be able to use win_main

I'm getting an error:

MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

-NiCo-
02-18-2008, 02:47 PM
Google (http://www.google.be/search?q=MSVCRTD.lib(crtexe.obj)+%3A+error+LNK2019 %3A+unresolved+external+symbol+_main+referenced+in +function+___tmainCRTStartup+&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a) is your friend :)

N.