akira.kuukisuzu akira.kuukisuzu - 6 months ago 34
Linux Question

Linux QT GCC OpenGL GLEW - add parameters to compiller

I want to create example GLFW file in C++.
When I type in Terminal

gcc FILENAME.cpp -lGL -lGLEW -lglfw
everything is OK,
but...
When I want to use CTRL+B to build my file in Qt Creator,
I see error
undefined reference to glfwInit
. I know I must add flags
-lGL -lGLEW -lglfw
, I tried to add
QMAKE_CXXFLAGS += -lGL -lGLEW -lglfw
in my
pro
file, but it does not work.

What is correct way to do this?

Answer

Wrong variable. You want

LIBS += -lGL -lGLEW -lglfw
Comments