QT creator with mingw, glew linking errors

时间:2015-07-13 21:12:01

标签: c++ qt mingw qt-creator glew

I've been trying for around 3/4 days to link glew with qt creator, but I´m unable to. I've tried with msvc and mingw 64 & 32 bits. Right now I´m using mingw 32 bits, and also a 32bits glew compiled with mingw.

This is the code in my .pro file:

QT       += core gui opengl

CONFIG += c++11

INCLUDEPATH += C:/lib/glew-gcc-debug-1.10.0-win32/include/GL

LIBS += -lglew32.dll -LC:/lib/glew-gcc-debug-1.10.0-win32/bin -LC:/lib/glew-gcc-debug-1.10.0-win32/lib


TARGET = Test
TEMPLATE = app


SOURCES += \
    glslprogram.cpp \
    glutils.cpp \
    main.cpp \
    mainview.cpp \
    mainwindow.cpp \
    sceneLine.cpp \
    dialog.cpp \
    viewpositiondialog.cpp

HEADERS  += \
    glslprogram.h \
    glutils.h \
    mainview.h \
    scene.h \
    mainwindow.h \
    sceneLine.h \
    dialog.h \
    viewpositiondialog.h

FORMS += \
    dialog.ui \
    viewpositiondialog.ui

OTHER_FILES += \
    shader/scenebasic2.dat

and this is is the output:

g++ -Wl,-subsystem,windows -mthreads -o debug\Test.exe object_script.Test.Debug  -lmingw32 -LC:/Qt/Qt5.5.0/5.5/mingw492_32/lib -lqtmaind -lshell32 -lglew32.dll -LC:/lib/glew-gcc-debug-1.10.0-win32/bin -LC:/lib/glew-gcc-debug-1.10.0-win32/lib -lQt5OpenGLd -lQt5Widgetsd -lQt5Guid -lQt5Cored 
./debug\glutils.o: In function `ZN7GLUtils19checkForOpenGLErrorEv':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:34: undefined reference to `glGetError@0'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:39: undefined reference to `glGetError@0'
Makefile.Debug:112: recipe for target 'debug\Test.exe' failed
./debug\glutils.o: In function `ZN7GLUtils10dumpGLInfoEb':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:46: undefined reference to `glGetString@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:47: undefined reference to `glGetString@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:48: undefined reference to `glGetString@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:49: undefined reference to `glGetString@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:52: undefined reference to `glGetIntegerv@8'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:53: undefined reference to `glGetIntegerv@8'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/glutils.cpp:63: undefined reference to `glGetIntegerv@8'
./debug\mainview.o: In function `ZN8MainView12initializeGLEv':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/mainview.cpp:113: undefined reference to `glClearColor@16'
./debug\sceneLine.o: In function `ZN9SceneLine9initSceneEv':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:279: undefined reference to `glClearColor@16'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:280: undefined reference to `glEnable@4'
./debug\sceneLine.o: In function `ZN9SceneLine6renderEPf':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:325: undefined reference to `glClear@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:336: undefined reference to `glDrawArrays@12'
./debug\sceneLine.o: In function `ZN9SceneLine6renderEdPf':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:350: undefined reference to `glClear@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:360: undefined reference to `glDrawArrays@12'
./debug\sceneLine.o: In function `ZN9SceneLine6renderEddddddPf':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:393: undefined reference to `glClear@4'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:417: undefined reference to `glDrawArrays@12'
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:421: undefined reference to `glDrawArrays@12'
./debug\sceneLine.o: In function `ZN9SceneLine6resizeEii':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/sceneLine.cpp:441: undefined reference to `glViewport@16'
./debug\sceneLine.o: In function `ZN5SceneC2Ev':
C:\Development\test\build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug/../Test/scene.h:4: undefined reference to `vtable for Scene'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: Leaving directory 'C:/Development/test/build-Test-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed

Hope someone can help.

0 个答案:

没有答案