Unsolved Qt GLFW and GLEW setup
-
-
Hi and welcome to devnet,
Before anything else, why do you need these libraries for ?
Qt already provides support for cross-platform OpenGL.The installation depends on your OS.
As for linking the libraries, you can use Qt Creator's wizard for that.
-
I just use Qt just for code editing. I guess that Qt own OpenGL libary are not the same as the original OpenGL libary.
And I just want to use original OpenGL.
-
Qt does not provide a custom implementation of OpenGL.
Please take a look at the Qt Gui module and what it offers for OpenGL handling.
-
But I can add libary to Qt, and GLFW is a libary
I created a project, right click on it, add libaries, internal libary, include the path to C:\glfw, and it does not allow me to push to the next button
-
Sure you can, but you might be adding unnecessary dependencies.
Is the library compiled ?
Does the architecture match the one you use for Qt ?
Which compiler was used ? -
I do not comailed the libary.
mingw73_64The other thing that I have tried is that
.proTEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt INCLUDEPATH += "C:\glfw\include\GLFW" SOURCES += \ main.cpp
#include <iostream> #include <glfw3.h> using namespace std; int main() { cout << "Hello World!" << endl; glfwInit(); return 0; }
C:\files\C++\file\main.cpp:9: error: undefined reference to `glfwInit'
-
You are not linking the library.
-
Maybe I am lame but I can't find a .lib file in GLFW folder file
In the GLEW folder C:\glew\lib\Release\x64 there is two .lib file but in the GLFW folder I cannot find any
-
link there is a pre compailed binary for visual studio
.pro file
TEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt INCLUDEPATH += "C:\glfw\include\GLFW" LIBS += -L"C:\glfw\lib-vc2019" -glfw3 SOURCES += \ main.cpp
main.cpp file
#include <iostream> #include <glfw3.h> using namespace std; int main() { cout << "Hello World!" << endl; glfwInit(); return 0; }
error: unrecognized debug output level 'lfw3'
-
@bence said in Qt GLFW and GLEW setup:
LIBS += -L"C:\glfw\lib-vc2019" -glfw3
error: unrecognized debug output level 'lfw3'
Where do yo u get the
-glfw3
from? Forgcc
, for example, the-g
is a compiler debugging flag, which would give your error. -
@JonB now I know that waht was the problem I have to use
LIBS += -L"C:\glfw\lib-vc2019" -lglfw3
But this time I get 120 issues
I assume that I cannot use GLFW Visual Studio precompile libary. But I cannot know what should I do.
-
@bence
If you only have libraries for VS/MSVC I believe you have to use that tool chain. -
I do not install VS to my PC.
I am sure that there is other way to do that.
I believe Qt is a excellent platform so there have to be a way to use original OpenGL
If you have any idea who could I use the original OpenGL in Qt I would really appriciate it.
-
Your issue is not related to Qt. You are trying to mix and match C++ libraries built with two different compilers. You can't use C++ libraries built with Visual Studio when using MinGW and it's the same the other way around.
As I already explained Qt does not implement a custom version of OpenGL. You already have access the functions. You are currently making your life more complicated than need be.
-
-
The page you linked provides libraries for a lot of compilers including MinGW 32 and 64 bit.
If you can't use any of them, the compile the library yourself.
-
@SGaist
I right click on the project and add the whole GLFW folder..pro file
TEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt INCLUDEPATH += "C:\glfw\include" INCLUDEPATH += "C:\glfw\deps" SOURCES += \ glfw/deps/getopt.c \ glfw/deps/glad_gl.c \ glfw/deps/glad_vulkan.c \ glfw/deps/tinycthread.c \ glfw/examples/boing.c \ glfw/examples/gears.c \ glfw/examples/heightmap.c \ glfw/examples/offscreen.c \ glfw/examples/particles.c \ glfw/examples/sharing.c \ glfw/examples/simple.c \ glfw/examples/splitview.c \ glfw/examples/wave.c \ glfw/src/cocoa_time.c \ glfw/src/context.c \ glfw/src/egl_context.c \ glfw/src/glx_context.c \ glfw/src/init.c \ glfw/src/input.c \ glfw/src/linux_joystick.c \ glfw/src/monitor.c \ glfw/src/null_init.c \ glfw/src/null_joystick.c \ glfw/src/null_monitor.c \ glfw/src/null_window.c \ glfw/src/osmesa_context.c \ glfw/src/posix_thread.c \ glfw/src/posix_time.c \ glfw/src/vulkan.c \ glfw/src/wgl_context.c \ glfw/src/win32_init.c \ glfw/src/win32_joystick.c \ glfw/src/win32_monitor.c \ glfw/src/win32_thread.c \ glfw/src/win32_time.c \ glfw/src/win32_window.c \ glfw/src/window.c \ glfw/src/wl_init.c \ glfw/src/wl_monitor.c \ glfw/src/wl_window.c \ glfw/src/x11_init.c \ glfw/src/x11_monitor.c \ glfw/src/x11_window.c \ glfw/src/xkb_unicode.c \ main.cpp DISTFILES += \ glfw/CMake/GenerateMappings.cmake \ glfw/CMake/MacOSXBundleInfo.plist.in \ glfw/CMake/i686-w64-mingw32-clang.cmake \ glfw/CMake/i686-w64-mingw32.cmake \ glfw/CMake/modules/FindEpollShim.cmake \ glfw/CMake/modules/FindOSMesa.cmake \ glfw/CMake/modules/FindWaylandProtocols.cmake \ glfw/CMake/modules/FindXKBCommon.cmake \ glfw/CMake/x86_64-w64-mingw32-clang.cmake \ glfw/CMake/x86_64-w64-mingw32.cmake \ glfw/CMakeLists.txt \ glfw/cmake_uninstall.cmake.in \ glfw/examples/CMakeLists.txt \ glfw/examples/glfw.icns \ glfw/examples/glfw.ico \ glfw/examples/glfw.rc \ glfw/src/CMakeLists.txt \ glfw/src/cocoa_init.m \ glfw/src/cocoa_joystick.m \ glfw/src/cocoa_monitor.m \ glfw/src/cocoa_window.m \ glfw/src/glfw3.pc.in \ glfw/src/glfw3Config.cmake.in \ glfw/src/glfw_config.h.in \ glfw/src/mappings.h.in \ glfw/src/nsgl_context.m HEADERS += \ glfw/deps/getopt.h \ glfw/deps/glad/gl.h \ glfw/deps/glad/khrplatform.h \ glfw/deps/glad/vk_platform.h \ glfw/deps/glad/vulkan.h \ glfw/deps/linmath.h \ glfw/deps/mingw/_mingw_dxhelper.h \ glfw/deps/mingw/dinput.h \ glfw/deps/mingw/xinput.h \ glfw/deps/nuklear.h \ glfw/deps/nuklear_glfw_gl2.h \ glfw/deps/stb_image_write.h \ glfw/deps/tinycthread.h \ glfw/deps/vs2008/stdint.h \ glfw/include/GLFW/glfw3.h \ glfw/include/GLFW/glfw3native.h \ glfw/src/cocoa_joystick.h \ glfw/src/cocoa_platform.h \ glfw/src/egl_context.h \ glfw/src/glx_context.h \ glfw/src/internal.h \ glfw/src/linux_joystick.h \ glfw/src/mappings.h \ glfw/src/nsgl_context.h \ glfw/src/null_joystick.h \ glfw/src/null_platform.h \ glfw/src/osmesa_context.h \ glfw/src/posix_thread.h \ glfw/src/posix_time.h \ glfw/src/wgl_context.h \ glfw/src/win32_joystick.h \ glfw/src/win32_platform.h \ glfw/src/wl_platform.h \ glfw/src/x11_platform.h \ glfw/src/xkb_unicode.h
The Qt recognize the function so everything is good. I click on rebuilt all projects
But when I try to built the program I get the following error:
And when I push the run button I get the a loads of errors
I use the code from link here.
-
GLFW already provides a mean to build their library. Use it.
-
And who to built it. I just find the way to use it in VS.