I’m trying to create an Glut window with Qt creator. All my code has been done on another computer. Now, I want to compile it on my own.
I’ve added the Glut32 library files in the following folders:
- glut32.lib into a lib/ foler in my project directory
- glut32.dll into my project directory
- glut.h into a GL/ folder in my project directory
In my pro files, I’ve added the following lines:
LIBS += -L$$PWD/lib/glut32.lib
LIBS += Opengl32.lib
And in my code, I’ve the following includes:
#include <gl/GL.h>
#include "GL/glut.h"
Qt does not report any error with the last include!
So, when I try to compile my code, I’ve many errors which say:
error LNK2019: unresolved external symbol
All those errors belongs to glut functions which cannot be found. So, did I do something wrong when I included the glut32 library?
Thanks.
Maybe it helps you to know, that you can output messages in your pro file, eg:
message("Location of glut32.lib" + $$PWD/lib/glut32.lib). So you could check, whether your path is ok. Also note, that you add libraries with-l<LibName>and library paths with-L<LibPath>, so you should try to replace-L$$PWD/lib/glut32.libby-l$$PWD/lib/glut32.libFor further options refer to the qmake variable reference