PDA

View Full Version : linking problem



Maxmagnus
05-16-2002, 03:16 PM
I have problem with linking and here is
what is reported to me.Compile went OK.

--------------------Configuration: vezba 05 17 gl - Win32 Debug--------------------
Linking...
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glClear@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
vezba 05 17 gl.obj : error LNK2001: unresolved external symbol _glutInit@8
Debug/vezba 05 17 gl.exe : fatal error LNK1120: 17 unresolved externals
Error executing link.exe.

vezba 05 17 gl.exe - 18 error(s), 0 warning(s)

The kode is not mine, the libreries included are Glut.h and gl.h which I resently downloaded.

yakuza
05-16-2002, 04:10 PM
You need to link opengl32.lib in your project settings.

05-16-2002, 04:34 PM
yup, but also link glut32.lib http://www.opengl.org/discussion_boards/ubb/smile.gif

Maxmagnus
05-17-2002, 05:02 AM
Libs are included but new problem
is here (who would thought so)
and now it is this:
--------------------Configuration: vezba 05 17 gl - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "glut32.lib"
Error executing link.exe.

vezba 05 17 gl.exe - 1 error(s), 0 warning(s)
Maxmagnus

Deiussum
05-17-2002, 05:16 AM
Did you download the glut32.lib file? And did you place it in one of the library search paths?

SenseOfLiquid
05-17-2002, 10:22 PM
I think I also have a problem along the same lines, because I'm running a Borland 5.02 compiler on Windows 2000 and it's telling me it can't open GL.h or glut.h. I know I have the headers in my include directory. I don't understand all that jazz about library paths either...can you help?

coredump
05-20-2002, 10:13 AM
i don't know much about borland, but in MSVC, you specify folders to look in for headers and libraries. these folders get searched when you #include a header. the library files you link your program with must be in the folders you have specified. if not, you'll get linker errors.

b

Maxmagnus
05-21-2002, 08:39 AM
I have found an answer for my question on another forum.
To make things as simple as possible I have to make 2 points about this problem
1. The forum I have found answers is not written in English.
2. There had to do several tings just to prepare compiler:
Some of them are:
1. Download glut.h glut.dll and glut.lib from this address: http://www.xmission.com/~nate/glut.html
2. Place glut.h in folder include/Gl/ which already contained gl.h and glu.h
3. Place glut.dll in my C:/windows/system folder.
4. Place glut.lib in my lib folder.
5. I had to add couple of .lib files for linking (opengl32.lib, glu32.lib, and glut32.lib)
and in VC++ that is done in Project -> Settings -> Link

AsylumX
05-21-2002, 04:03 PM
Yeah, downloading the required files usually helps http://www.opengl.org/discussion_boards/ubb/wink.gif

I had to go through all that a couple weeks ago so I know how you feel!