Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

c++ - Add GLFW and GLEW to Qt

I dowloaded GLFW Windows pre-compiled binaries from link the 64-but one. After that I created a Qt project and then right click on the project I added and external libary I borowse lib-mingw-w64 folder and add libglfw3.a file I diasable 'Linux' and 'Mac' platform and disable 'Add "d" suffix for debug version' so now my .pro file looks like this:

TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt

INCLUDEPATH += C:glfw3.2include

SOURCES += main.cpp

win32: LIBS += -L$$PWD/../../../../glfw/lib-mingw-w64/ -lglfw3

INCLUDEPATH += $$PWD/../../../../glfw/lib-mingw-w64
DEPENDPATH += $$PWD/../../../../glfw/lib-mingw-w64

Main.cpp file I copy and paste an example code from link At main.cpp I #include <GLFW/glfw3.h>

When I Rebuilt all project I got 32 issues:

main.cpp:32: error: undefined reference to `__imp_glClear'
win32_monitor.c:-1: error: undefined reference to `__imp_CreateDCW'
win32_monitor.c:-1: error: undefined reference to `__imp_GetDeviceCaps'
win32_monitor.c:-1: error: undefined reference to `__imp_DeleteDC'
win32_monitor.c:-1: error: undefined reference to `__imp_GetDeviceCaps'
win32_monitor.c:-1: error: undefined reference to `__imp_GetDeviceCaps'
win32_monitor.c:-1: error: undefined reference to `__imp_GetDeviceCaps'
win32_monitor.c:-1: error: undefined reference to `__imp_CreateDCW'
win32_monitor.c:-1: error: undefined reference to `__imp_GetDeviceGammaRamp'
win32_monitor.c:-1: error: undefined reference to `__imp_DeleteDC'
....

I am using:

Qt 5.13.0

mingw73_64

Win 10 64-bit

question from:https://stackoverflow.com/questions/65869815/add-glfw-and-glew-to-qt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...