对'imp____glewEnableVertexAttribArray'的未定义引用 [英] Undefined reference to 'imp____glewEnableVertexAttribArray'

查看:829
本文介绍了对'imp____glewEnableVertexAttribArray'的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一个程序,我正在做的教程是用C ++编写的,并打开gl 2.1。但是,我不喜欢FreeGLUT,所以我决定将窗口程序更改为SFML。我的问题是,当我尝试建立程序,我得到这些错误:

I'm trying to compile a program I am doing from a tutorial which is written in C++ and open gl 2.1. However, I don't like FreeGLUT so I decided to change the windowing program to SFML. My problem is however when I try to build the program I get these errors:

obj\Debug\main.o||In function `Z6renderv':|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|36|undefined reference to `_imp____glewUseProgram'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|37|undefined reference to `_imp____glewEnableVertexAttribArray'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|52|undefined reference to `_imp____glewVertexAttribPointer'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|56|undefined reference to `_imp____glewDisableVertexAttribArray'|
obj\Debug\main.o||In function `Z11initShadersv':|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|62|undefined reference to `_imp____glewCreateProgram'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|67|undefined reference to `_imp____glewLinkProgram'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|68|undefined reference to `_imp____glewGetProgramiv'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|76|undefined reference to `_imp____glewGetAttribLocation'|
obj\Debug\main.o||In function `Z16initVertexShaderv':|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|86|undefined reference to `_imp____glewCreateShader'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|95|undefined reference to `_imp____glewShaderSource'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|96|undefined reference to `_imp____glewCompileShader'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|97|undefined reference to `_imp____glewGetShaderiv'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|103|undefined reference to `_imp____glewAttachShader'|
obj\Debug\main.o||In function `Z18initFragmentShaderv':|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|109|undefined reference to `_imp____glewCreateShader'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|119|undefined reference to `_imp____glewShaderSource'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|120|undefined reference to `_imp____glewCompileShader'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|121|undefined reference to `_imp____glewGetShaderiv'|
C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|128|undefined reference to `_imp____glewAttachShader'|
||=== Build finished: 18 errors, 0 warnings ===|

我在程序中包含以下库:

I've included the following libraries in the program:

#include <GL/glew.h>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

我也链接这些:

-lsfml-system
-lsfml-window
-lopengl32
-lglu32
-lglew32


推荐答案

http://julianibarz.wordpress.com/2010/05/12/glew-1-5-4-mingw32/

有GLEW for mingw32 - 项目编译良好。

Got GLEW for mingw32 - project compiles fine.

这篇关于对'imp____glewEnableVertexAttribArray'的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆