Reputation: 8702
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:
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.
Upvotes: 1
Views: 3109
Reputation: 1099
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.lib
by -l$$PWD/lib/glut32.lib
For further options refer to the qmake variable reference
Upvotes: 1